Skip to content

Commit

Permalink
fix content provider metadata population
Browse files Browse the repository at this point in the history
Signed-off-by: Anupam Kumar <[email protected]>
  • Loading branch information
kyteinsky committed Dec 16, 2024
1 parent 930df51 commit ccfa176
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Service/MetadataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function getEnrichedSources(string $userId, string ...$sources): array {
continue;
}

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

0 comments on commit ccfa176

Please sign in to comment.