Skip to content

Commit 66dd968

Browse files
committed
Fix file sorting e.g. for gallery
1 parent 02243df commit 66dd968

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Helper/ToolboxFile.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of MetaModels/core.
55
*
6-
* (c) 2012-2025 The MetaModels team.
6+
* (c) 2012-2026 The MetaModels team.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -20,7 +20,7 @@
2020
* @author Ingolf Steinhardt <[email protected]>
2121
* @author Sven Baumann <[email protected]>
2222
* @author Andreas Fischer <[email protected]>
23-
* @copyright 2012-2025 The MetaModels team.
23+
* @copyright 2012-2026 The MetaModels team.
2424
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
2525
* @filesource
2626
*/
@@ -802,6 +802,10 @@ protected function sortByIdList($sortIds)
802802
$fileKeys = array_flip(array_keys($this->uuidMap));
803803
$sorted = [];
804804
foreach ($sortIds as $sortStringId) {
805+
if (!isset($fileKeys[$sortStringId])) {
806+
continue;
807+
}
808+
805809
$key = $fileKeys[$sortStringId];
806810
$sorted[$key] = $fileMap[$key];
807811
unset($fileMap[$key]);

0 commit comments

Comments
 (0)