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.
This commit is contained in:
Daniel Siepmann 2022-12-21 08:48:47 +01:00
parent c2c08480c3
commit 8d71f0862c

View file

@ -64,6 +64,10 @@ class NaturalSortingProcessor implements DataProcessorInterface
throw new \Exception('Variable at "' . $variablePath . '" was not of type array.', 1667911071); 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) { usort($valuesToSort, function (array $variable1, array $variable2) use ($variableSubPath) {
$value1 = ArrayUtility::getValueByPath($variable1, $variableSubPath); $value1 = ArrayUtility::getValueByPath($variable1, $variableSubPath);
$value2 = ArrayUtility::getValueByPath($variable2, $variableSubPath); $value2 = ArrayUtility::getValueByPath($variable2, $variableSubPath);