mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 17:34:32 +02:00
Fixed sorting for element choice type and added tests
This commit is contained in:
parent
61f02d693f
commit
1ec4266f96
5 changed files with 167 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue