mirror of
https://github.com/getgrav/grav.git
synced 2026-07-08 10:42:08 +02:00
Fixed FlexIndex::call() to return null instead of failing to call undefined method
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user