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_html().

function template_process_html(&$variables) {
  drupal_add_library('system', 'html5shiv', TRUE);
  // Render page_top and page_bottom into top level variables.
  $variables['page_top'] = drupal_render($variables['page']['page_top']);
  $variables['page_bottom'] = drupal_render($variables['page']['page_bottom']);
  // Place the rendered HTML for the page body into a top level variable.
  $variables['page']              = $variables['page']['#children'];
  $variables['page_bottom'] .= drupal_get_js('footer');

  $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_html function needs to be removed from Drupal 8.

Remaining tasks

- All the calls to drupal_render need to be replaced with __toString methods on the renderable object.
- Calls to drupal_get_css and drupal_get_js can be moved up to the preprocess layer, since they return renderables.
- Remove $variables['css'] = drupal_add_css(); leftovers?
- Move $variables['page'] = $variables['page']['#children']; into a __toString method?

User interface changes

None.

API changes

TBD

Blockers (Issues)

#1843710: Remove template_process_maintenance_page()

#1843650: Remove the process layer (hook_process and hook_process_HOOK)
#2004286: Defer calls to drupal_get_* functions until printed inside a template by adding a RenderWrapper class

Comments

gregtorok’s picture

working on this one

mlncn’s picture

Status: Active » Closed (duplicate)

gregtorok, i think this has been taken care of by the removal of template_process_html() in #2004286: Defer calls to drupal_get_* functions until printed inside a template by adding a RenderWrapper class -- could you take a look? Hope no one duplicated work.

mlncn’s picture

Issue summary: View changes

blocker

mlncn’s picture

Issue summary: View changes

Added duplicate/related issue.