diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 40c4ae7..9c71f09 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -19,6 +19,7 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Batch\Percentage; use Drupal\Core\Form\FormState; +use Drupal\Core\Render\HtmlResponse; use Drupal\Core\Url; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 39589c2..cfd2ab9 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -288,29 +288,6 @@ function views_theme_suggestions_container_alter(array &$suggestions, array $var } /** - * Implements hook_element_info_alter(). - * - * @see views_page_display_pre_render() - * @see views_preprocess_page() - */ -function views_element_info_alter(&$types) { - $types['page']['#pre_render'][] = 'views_page_display_pre_render'; -} - -/** - * #pre_render callback to set contextual links for views using a Page display. - */ -function views_page_display_pre_render(array $element) { - // If the main content of this page contains a view, attach its contextual - // links to the overall page array. This allows them to be rendered directly - // next to the page title. - if ($view = views_get_page_view()) { - views_add_contextual_links($element, 'page', $view, $view->current_display); - } - return $element; -} - -/** * Implements MODULE_preprocess_HOOK(). */ function views_preprocess_html(&$variables) { @@ -319,6 +296,13 @@ function views_preprocess_html(&$variables) { return; } + // If the main content of this page contains a view, attach its contextual + // links to the overall page array. This allows them to be rendered directly + // next to the page title. + if ($view = views_get_page_view()) { + views_add_contextual_links($variables['page'], 'page', $view, $view->current_display); + } + // If the page contains a view as its main content, contextual links may have // been attached to the page as a whole; for example, by // views_page_display_pre_render().