From d3f1f833ab7fae9bf71d03e26defc2b58fce5aeb Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 9 Nov 2020 19:47:00 +0200 Subject: [PATCH] Fixed sorting by groups in `Flex Users` --- CHANGELOG.md | 2 +- .../Framework/Object/Collection/ObjectExpressionVisitor.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b72500a..21fd92789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * Fixed media crashing on a bad image * Fixed bug in collections where filter `type: false` did not work * Fixed `print_r()` in twig + * Fixed sorting by groups in `Flex Users` # v1.7.0-rc.17 ## 10/07/2020 @@ -500,7 +501,6 @@ * Fixed hardcoded system folder in blueprints, config and language streams * Added `.htaccess` rule to block attempts to use Twig in the request URL - # v1.6.28 ## 10/07/2020 diff --git a/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php b/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php index 36ab7591c..917105d72 100644 --- a/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php +++ b/system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php @@ -11,6 +11,7 @@ namespace Grav\Framework\Object\Collection; use Doctrine\Common\Collections\Expr\ClosureExpressionVisitor; use Doctrine\Common\Collections\Expr\Comparison; +use function is_callable; class ObjectExpressionVisitor extends ClosureExpressionVisitor { @@ -27,7 +28,7 @@ class ObjectExpressionVisitor extends ClosureExpressionVisitor $pos = strpos($field, '('); if (false !== $pos) { - list ($op, $field) = explode('(', $field, 2); + [$op, $field] = explode('(', $field, 2); $field = rtrim($field, ')'); } @@ -39,7 +40,7 @@ class ObjectExpressionVisitor extends ClosureExpressionVisitor foreach ($accessors as $accessor) { $accessor .= $field; - if (!method_exists($object, $accessor)) { + if (!is_callable([$object, $accessor])) { continue; }