diff --git a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php index 5fcf990..7b69ad4 100644 --- a/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php @@ -24,6 +24,16 @@ public function getImplementations($hook) { if (substr($hook, -6) === '_alter') { return array(); } + // Allow system_theme_suggestions_maintenance_page() for the offline + // maintenance page theme suggestion. + if ($hook == 'theme_suggestions_maintenance_page') { + return array('system'); + } + // theme() is called during updates and fires suggestion hooks but we do + // not allow this during updates. + if (strpos($hook, 'theme_suggestions_') !== FALSE) { + return array(); + } switch ($hook) { // hook_requirements is necessary for updates to work. case 'requirements': diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index d592718..16aee73 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -585,22 +585,23 @@ function forum_preprocess_block(&$variables) { */ function forum_theme_suggestions_forums(array $variables) { $suggestions = array(); + $tid = $variables['term']->id(); // Provide separate template suggestions based on what's being output. Topic // ID is also accounted for. Check both variables to be safe then the inverse. // Forums with topic IDs take precedence. if ($variables['forums'] && !$variables['topics']) { $suggestions[] = 'forums__containers'; - $suggestions[] = 'forums__' . $variables['tid']; - $suggestions[] = 'forums__containers__' . $variables['tid']; + $suggestions[] = 'forums__' . $tid; + $suggestions[] = 'forums__containers__' . $tid; } elseif (!$variables['forums'] && $variables['topics']) { $suggestions[] = 'forums__topics'; - $suggestions[] = 'forums__' . $variables['tid']; - $suggestions[] = 'forums__topics__' . $variables['tid']; + $suggestions[] = 'forums__' . $tid; + $suggestions[] = 'forums__topics__' . $tid; } else { - $suggestions[] = 'forums__' . $variables['tid']; + $suggestions[] = 'forums__' . $tid; } return $suggestions; diff --git a/core/modules/system/tests/modules/theme_test/theme_test.routing.yml b/core/modules/system/tests/modules/theme_test/theme_test.routing.yml index ef028f6..b4a7fd6 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.routing.yml +++ b/core/modules/system/tests/modules/theme_test/theme_test.routing.yml @@ -43,28 +43,28 @@ theme_test.request_listener: _access: 'TRUE' suggestion_alter: - pattern: '/theme-test/suggestion-alter' + path: '/theme-test/suggestion-alter' defaults: _content: '\Drupal\theme_test\ThemeTestController::suggestionAlter' requirements: _permission: 'access content' suggestion_provided: - pattern: '/theme-test/suggestion-provided' + path: '/theme-test/suggestion-provided' defaults: _content: '\Drupal\theme_test\ThemeTestController::suggestionProvided' requirements: _permission: 'access content' specific_suggestion_alter: - pattern: '/theme-test/specific-suggestion-alter' + path: '/theme-test/specific-suggestion-alter' defaults: _content: '\Drupal\theme_test\ThemeTestController::specificSuggestionAlter' requirements: _permission: 'access content' function_suggestion_alter: - pattern: '/theme-test/function-suggestion-alter' + path: '/theme-test/function-suggestion-alter' defaults: _content: '\Drupal\theme_test\ThemeTestController::functionSuggestionAlter' requirements: