From 8d71f0862c60ee59062c9d1e28f4c97aeae5319c Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 21 Dec 2022 08:48:47 +0100 Subject: [PATCH] Fix empty compatibleWith list This is not nice, we should use have within query but that would mean we need to create our own processor. That's why I hotfix within the existing one. --- Classes/Frontend/DataProcessing/NaturalSortingProcessor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php b/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php index f5244c3..27b5541 100644 --- a/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php +++ b/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php @@ -64,6 +64,10 @@ class NaturalSortingProcessor implements DataProcessorInterface throw new \Exception('Variable at "' . $variablePath . '" was not of type array.', 1667911071); } + $valuesToSort = array_filter($valuesToSort, function (array $value) use ($variableSubPath) { + return ArrayUtility::getValueByPath($value, $variableSubPath); + }); + usort($valuesToSort, function (array $variable1, array $variable2) use ($variableSubPath) { $value1 = ArrayUtility::getValueByPath($variable1, $variableSubPath); $value2 = ArrayUtility::getValueByPath($variable2, $variableSubPath);