From ab02f561bf68135c0f86d2bc11e4b5215286485a Mon Sep 17 00:00:00 2001 From: AaronGilMartinez Date: Mon, 16 Jan 2023 12:42:55 +0000 Subject: [PATCH] OE-List-pages-157: Add condition for matching sorts. --- src/ListExecutionManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ListExecutionManager.php b/src/ListExecutionManager.php index 29e2f921..5614c626 100644 --- a/src/ListExecutionManager.php +++ b/src/ListExecutionManager.php @@ -97,7 +97,8 @@ public function executeList(ListPageConfiguration $configuration): ?ListExecutio // If we have a specific sort, we use that first, followed by the default // bundle sort. Otherwise, just the bundle sort. $sort = $sort ? [$sort['name'] => $sort['direction']] : []; - if ($bundle_sort) { + // We apply default sorting when is set or doesn't match with applied. + if (!empty($bundle_sort) && !isset($sort[$bundle_sort['name']])) { $sort[$bundle_sort['name']] = $bundle_sort['direction']; }