Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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_overlay().
function template_process_overlay(&$variables) {
$variables['page'] = $variables['page']['#children'];
}
Proposed resolution
The template_process_overlay function needs to be removed from Drupal 8.
Remaining tasks
- Move this change of $variables['page']
to someplace else.
- Perhaps provide this change as part of a __toString method on the renderable object.
User interface changes
None.
API changes
None.
Related Issues
#1843650: Remove the process layer (hook_process and hook_process_HOOK)
Comments
Comment #1
pmelab CreditAttribution: pmelab commentedWorking with lollypic on it.
Comment #2
pmelab CreditAttribution: pmelab commentedRemoved template_process_overlay and moved contents into template_preprocess_overlay.
Comment #4
evanmwillhite CreditAttribution: evanmwillhite commented#2: overlay-remove_template_process_overlay-1843768-2.patch queued for re-testing.
Comment #6
evanmwillhite CreditAttribution: evanmwillhite commentedRerolled patch against latest tip
Comment #7
evanmwillhite CreditAttribution: evanmwillhite commentedComment #8
gregtorok CreditAttribution: gregtorok commentedComment #9
iankp CreditAttribution: iankp commentedChanging status so test bot tests the latest patch.
Comment #11
dirtabulous CreditAttribution: dirtabulous commented#8: overlay-remove_template_process_overlay-1843768-3.patch queued for re-testing.
Comment #13
gg4 CreditAttribution: gg4 commentedRerolled patch.
Comment #15
gg4 CreditAttribution: gg4 commented#13: overlay-remove_template_process_overlay-1843768-13.patch queued for re-testing.
Comment #16
dasjothe given patch(es) only remove stuff, i can't see where it is added again?
Comment #17
star-szrWould like some manual testing on #13 - I can see it potentially being correct.
Comment #18
tlattimore CreditAttribution: tlattimore commentedI did some manual testing with daisydiff on this and everything seems to be working correctly... Not really sure why we can delete this entire function and it not affect anything, but that seems the case.
Comment #19
star-szrThanks for testing @tlattimore! I confirmed the testing results locally as well.
Here, Twig is running the page variable through render() which calls drupal_render(). drupal_render() will render the #children without any difficulty. So this makes sense to me. If you wanted to make a PHPTemplate version of the overlay template you would just do:
print render($page);
overlay.tpl.php pre-conversion just did:
print $page;
Comment #20
alexpottCommitted e3011f8 and pushed to 8.x. Thanks!
Comment #21.0
(not verified) CreditAttribution: commentedWe have been informed that the __toString method will not be used until Drupal 9