From c3e6a227d04d5fc7b9d7fe83760ac5c4dffca227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ausw=C3=B6ger?= Date: Wed, 9 Sep 2020 15:14:35 +0200 Subject: [PATCH] Keep fileTree sorting order when changing selection (see #2267) Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes #2266 Commits ------- b63977f2 Keep fileTree sorting order when changing selection --- core-bundle/src/Resources/contao/classes/Ajax.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-bundle/src/Resources/contao/classes/Ajax.php b/core-bundle/src/Resources/contao/classes/Ajax.php index 4ad03905e0d..51f2bbd0442 100644 --- a/core-bundle/src/Resources/contao/classes/Ajax.php +++ b/core-bundle/src/Resources/contao/classes/Ajax.php @@ -376,6 +376,9 @@ public function executePostActions(DataContainer $dc) } } + // Keep the previous sorting order when reloading the widget + $varValue = ArrayUtil::sortByOrderField($varValue, $dc->activeRecord->$strField); + $varValue = serialize($varValue); }