X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FAccess%2FCustomAccessCheck.php;h=353d09cd8060829bdd094ebbfec22bfc30a4a580;hb=refs%2Fheads%2Fd864;hp=e7a3b0891504b4b509dfc24c169e0a01a27869c4;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Access/CustomAccessCheck.php b/web/core/lib/Drupal/Core/Access/CustomAccessCheck.php index e7a3b0891..353d09cd8 100644 --- a/web/core/lib/Drupal/Core/Access/CustomAccessCheck.php +++ b/web/core/lib/Drupal/Core/Access/CustomAccessCheck.php @@ -61,7 +61,14 @@ class CustomAccessCheck implements RoutingAccessInterface { * The access result. */ public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) { - $callable = $this->controllerResolver->getControllerFromDefinition($route->getRequirement('_custom_access')); + try { + $callable = $this->controllerResolver->getControllerFromDefinition($route->getRequirement('_custom_access')); + } + catch (\InvalidArgumentException $e) { + // The custom access controller method was not found. + throw new \BadMethodCallException(sprintf('The "%s" method is not callable as a _custom_access callback in route "%s"', $route->getRequirement('_custom_access'), $route->getPath())); + } + $arguments_resolver = $this->argumentsResolverFactory->getArgumentsResolver($route_match, $account); $arguments = $arguments_resolver->getArguments($callable);