diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index efa3446..a3054e3 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -647,7 +647,7 @@ protected function mergePreprocessFunctions($destination_hook_name, $source_hook // If base hook exists clone of it for the preprocess function // without a template. // @see https://www.drupal.org/node/2457295 - if (isset($cache[$source_hook_name]) && !isset($cache[$source_hook_name]['incomplete preprocess functions'])) { + if (isset($cache[$source_hook_name]) && (!isset($cache[$source_hook_name]['incomplete preprocess functions']) || !isset($cache[$destination_hook_name]['incomplete preprocess functions']))) { $cache[$destination_hook_name] = $parent_hook + $cache[$source_hook_name]; if (isset($parent_hook['preprocess functions'])) { $diff = array_diff($parent_hook['preprocess functions'], $cache[$source_hook_name]['preprocess functions']); diff --git a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php index e74a904..8be62d8 100644 --- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php @@ -363,7 +363,6 @@ public function providerTestPostProcessExtension() { // Same as above, but also test that such child hooks can also be extended // with magically named suggestions. - /* $data['child_hook_with_suggestions'] = [ 'defined_functions' => [ 'test_preprocess_child_hook__suggestion', @@ -411,7 +410,6 @@ public function providerTestPostProcessExtension() { ], ], ]; - */ // Test that a suggestion following the "__" naming pattern can specify a // different base hook than what is implied by that pattern. Ensure that