Commit 97824be6 authored by Adrien Morais-Mestre's avatar Adrien Morais-Mestre Committed by Adrien Morais
Browse files

fix(resources): correctly display icons shared by multiple resources (#11103)

parent f501d843
......@@ -549,10 +549,13 @@ class DbReadResourceRepository extends AbstractRepositoryDRB implements Resource
$statement->execute(array_values($iconIds));
while ($record = $statement->fetch(\PDO::FETCH_ASSOC)) {
$resourceIndex = array_search((int) $record['icon_id'], $iconIds);
$resources[$resourceIndex]->getIcon()
?->setName($record['icon_name'])
->setUrl($record['icon_directory'] . DIRECTORY_SEPARATOR . $record['icon_path']);
$resourceIndexes = array_keys($iconIds, (int) $record['icon_id']);
foreach ($resourceIndexes as $resourceIndex) {
$resources[$resourceIndex]->getIcon()
?->setName($record['icon_name'])
->setUrl($record['icon_directory'] . DIRECTORY_SEPARATOR . $record['icon_path']);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment