Skip to content

Commit c3e9598

Browse files
authored
fix content provider metadata population (#81)
Signed-off-by: Anupam Kumar <[email protected]>
1 parent 930df51 commit c3e9598

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Service/MetadataService.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getEnrichedSources(string $userId, string ...$sources): array {
133133
continue;
134134
}
135135

136-
$providerKey = explode('__', $source, 2)[0];
136+
$providerKey = explode(': ', $source, 2)[0];
137137
if (!array_key_exists($providerKey, $enrichedProviders)) {
138138
$this->logger->warning('Could not find content provider by key', ['providerKey' => $providerKey, 'enrichedProviders' => $enrichedProviders]);
139139
continue;
@@ -149,8 +149,10 @@ public function getEnrichedSources(string $userId, string ...$sources): array {
149149
try {
150150
/** @var IContentProvider */
151151
$klass = Server::get($providerConfig['classString']);
152-
$url = $klass->getItemUrl($this->getIdFromSource($source));
152+
$itemId = $this->getIdFromSource($source);
153+
$url = $klass->getItemUrl($itemId);
153154
$provider['url'] = $url;
155+
$provider['label'] .= ' #' . $itemId;
154156
$enrichedSources[] = $provider;
155157
} catch (ContainerExceptionInterface|NotFoundExceptionInterface $e) {
156158
$this->logger->warning('Could not find content provider by class name', ['classString' => $providerConfig['classString'], 'exception' => $e]);

0 commit comments

Comments
 (0)