Fixed sorting for element choice type and added tests

This commit is contained in:
Jan Böhmer 2023-07-23 01:01:29 +02:00
parent 61f02d693f
commit 1ec4266f96
5 changed files with 167 additions and 5 deletions

View file

@ -62,8 +62,7 @@ class AttachmentContainingDBElementRepository extends NamedDBElementRepository
$q->setFetchMode($this->getEntityName(), 'master_picture_attachment', ClassMetadataInfo::FETCH_EAGER);
$result = $q->getResult();
$result = array_combine($ids, $result);
$result = array_map(fn ($id) => $result[$id], $ids);
$this->sortResultArrayByIDArray($result, $ids);
//Cache the result
$this->elementsAndPreviewAttachmentCache[$cache_key] = $result;