Fixed FlexIndex::call() to return null instead of failing to call undefined method

This commit is contained in:
Matias Griese
2021-12-20 14:46:20 +02:00
parent bfc9e26f26
commit 26295d5cf2
2 changed files with 8 additions and 3 deletions

View File

@@ -21,6 +21,7 @@
* Disabled pretty debug info for Flex as it slows down Twig rendering
* Fixed Twig being very slow when template overrides do not exist
* Fixed `UserObject::$authorizeCallable` binding to the user object
* Fixed `FlexIndex::call()` to return null instead of failing to call undefined method
# v1.7.25
## 11/16/2021

View File

@@ -502,9 +502,13 @@ class FlexIndex extends ObjectIndex implements FlexIndexInterface
}
} else {
$collection = $this->loadCollection();
$result = $collection->{$name}(...$arguments);
if (!isset($cachedMethods[$name])) {
$debugger->addMessage("Call '{$flexType}:{$name}()' isn't cached", 'debug');
if (\is_callable([$collection, $name])) {
$result = $collection->{$name}(...$arguments);
if (!isset($cachedMethods[$name])) {
$debugger->addMessage("Call '{$flexType}:{$name}()' isn't cached", 'debug');
}
} else {
$result = null;
}
}