diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 141b98f..ca7bc62 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1958,7 +1958,7 @@ function module_implements($hook) { * * @see \Drupal\Core\Extension\ModuleHandler::invoke() */ -function module_invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL) { +function module_invoke($module, $hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL) { return \Drupal::moduleHandler()->invoke($module, $hook, $context1, $context2, $context3, $context4); } @@ -1970,7 +1970,7 @@ function module_invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$c * * @see \Drupal\Core\Extension\ModuleHandler::invokeAll() */ -function module_invoke_all($hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL) { +function module_invoke_all($hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL) { return \Drupal::moduleHandler()->invokeAll($hook, $context1, $context2, $context3, $context4); } diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 3c2c92b..14484e5 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -411,11 +411,9 @@ protected function prepareInvokeAll($hook, array &$form_state) { $implementations = $this->moduleHandler->getImplementations($hook); foreach ($implementations as $module) { $function = $module . '_' . $hook; - if (function_exists($function)) { - // Ensure to pass an updated form display at each invocation, since it - // depends on form state which is alterable. - $function($this->entity, $this->getFormDisplay($form_state), $this->operation, $form_state); - } + // Ensure to pass an updated form display at each invocation, since it + // depends on form state which is alterable. + $function($this->entity, $this->getFormDisplay($form_state), $this->operation, $form_state); } } diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 51e6575..7893662 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -264,7 +264,7 @@ public function implementsHook($module, $hook) { /** * Implements \Drupal\Core\Extension\ModuleHandlerInterface::invoke(). */ - public function invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL) { + public function invoke($module, $hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL) { if (!$this->implementsHook($module, $hook)) { return; } @@ -275,7 +275,7 @@ public function invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$c /** * Implements \Drupal\Core\Extension\ModuleHandlerInterface::invokeAll(). */ - public function invokeAll($hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL) { + public function invokeAll($hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL) { $return = array(); $implementations = $this->getImplementations($hook); foreach ($implementations as $module) { diff --git a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php index c41e1d7..c58691a 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php @@ -193,7 +193,7 @@ public function implementsHook($module, $hook); * @return mixed * The return value of the hook implementation. */ - public function invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL); + public function invoke($module, $hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL); /** * Invokes a hook in all enabled modules that implement it. @@ -215,7 +215,7 @@ public function invoke($module, $hook, &$context1 = NULL, &$context2 = NULL, &$c * An array of return values of the hook implementations. If modules return * arrays from their implementations, those are merged into one array. */ - public function invokeAll($hook, &$context1 = NULL, &$context2 = NULL, &$context3 = NULL, &$context4 = NULL); + public function invokeAll($hook, $context1 = NULL, $context2 = NULL, $context3 = NULL, $context4 = NULL); /** * Passes alterable variables to specific hook_TYPE_alter() implementations.