Problem/Motivation

We are eliminating the process layer from Drupal 8, since the reasons for it's existence can now be solved in different ways. One of the functions on the chopping block is template_process_maintenance_page().

function template_process_maintenance_page(&$variables) {
  $variables['head']    = drupal_get_html_head();
  $variables['css']     = drupal_add_css();
  $variables['styles']  = drupal_get_css();
  $variables['scripts'] = drupal_get_js();
}

Proposed resolution

The template_process_maintenance_page function needs to be removed from Drupal 8.

Remaining tasks

- Move addition of all variables that are renderables to the preprocess layer
- delete the function template_process_maintenance_page

User interface changes

None.

API changes

TBD

#1843708: drupal_get_html_head() should not call drupal_render

#1843650: Remove the process layer (hook_process and hook_process_HOOK)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Issue tags: +Twig, +theme system cleanup

tagging.

star-szr’s picture

Title: Remvoe template_process_maintenance_page() » Remove template_process_maintenance_page()

Fixing typo in title.

dirtabulous’s picture

Status: Active » Needs review
FileSize
2.56 KB

-Moved all variables to the preprocess layer
-deleted the function template_process_maintenance_page

dirtabulous’s picture

Rerolled patch. Includes fix for Bartik theme and the maintenance css.

Status: Needs review » Needs work
Issue tags: -Twig, -theme system cleanup

The last submitted patch, core-remove_template_process_maintenance_page-1843710-4.patch, failed testing.

dirtabulous’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Twig, +theme system cleanup

The last submitted patch, core-remove_template_process_maintenance_page-1843710-4.patch, failed testing.

dasjo’s picture

Status: Needs work » Needs review

attached is a reroll that moves the bartik related fix over to #2003814-11: Remove Bartik process layer functions, refactor color module alterations in order to prevent patches conflicting each other.

dasjo’s picture

tlattimore’s picture

+++ b/core/includes/theme.incundefined
@@ -3131,6 +3131,15 @@ function template_preprocess_maintenance_page(&$variables) {
+  $variables['css'] = $css = drupal_add_css();

This seem like it's a goofy way to write this but it's how it is already written for the template_process_maintenance_page() function.

I guess the goal of this issue isn't really cleanup, just to get rid of process function. From that standpoint it looks good to me.

jenlampton’s picture

Status: Needs review » Needs work
Issue tags: +Twig, +theme system cleanup

The last submitted patch, core-remove_template_process_maintenance_page-1843710-8.patch, failed testing.

jenlampton’s picture

Issue tags: +Needs reroll

thought it might fail :/

LinL’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.5 KB

Re-rolled.

Status: Needs review » Needs work

The last submitted patch, core-remove_template_process_maintenance_page-1843710-14.patch, failed testing.

LinL’s picture

Failed because language_css_alter() is gone #2015789: Remove language_css_alter() (RTL stylesheets) in favor of HTML 'dir' attribute

Is it as simple as just deleting that line?

LinL’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, core-remove_template_process_maintenance_page-1843710-15.patch, failed testing.

LinL’s picture

Also noticed a reference to template_process_maintenance_page here:

/**
 * Preprocess variables for install-page.html.twig.
 *
 * @see install-page.html.twig
 * @see template_process_html()
 *
 */
function template_process_install_page(&$variables) {
  template_process_maintenance_page($variables);
}

Not sure what that should be replaced with?

star-szr’s picture

Status: Needs work » Closed (duplicate)

I didn't realize when this came up for reroll that #2004286: Defer calls to drupal_get_* functions until printed inside a template by adding a RenderWrapper class actually removes template_process_maintenance_page(). I think we can close this one as a duplicate. Thanks very much for your work on both issues @LinL :)