Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.5.6
-
None
Description
PageBuilder
In EzSystems\EzPlatformPageBuilder\HTTP\Kernel\Fragment\DecoratedFragmentRenderer:
private function doesReferenceBlockRender(ControllerReference $controllerReference): bool { $controllerCallable = $this->controllerResolver->getCallableFromControllerReference($controllerReference); return $controllerCallable[0] instanceof BlockController && 'renderAction' === $controllerCallable[1]; }
If the $controllerCallable is an object implementing __invoke() method (which is a valid callable type), the exception will be thrown on the return line (cannot use object as an array).
Page Field type
In EzSystems\EzPlatformPageFieldType\FragmentRenderer\BlockRenderOptionsFragmentRenderer:
private function isBlockRenderRequest(ControllerReference $controllerReference): bool { $mockRequest = $this->mockRequest($controllerReference); $controller = $this->controllerResolver->getController($mockRequest); if (!\is_callable($controller)) { return false; } return $controller[0] instanceof BlockController && 'renderAction' === $controller[1]; }
Same type of error as in the first example.
In both methods, there should be additional check before the return statement - if the given callable is not an array, return false.