Move template_preprocess, _template_preprocess_default_variables into services

Created on 17 September 2014, over 10 years ago
Updated 2 July 2024, 6 months ago

Problem/Motivation

Coming from #2325571-7: Replace _theme() calls by calls to \Drupal::theme()->render() @alexpott suggested moving template_preprocess and _template_preprocess_default_variables into one of the Theme services. @dawehner created this issue as a follow up with original title: 'Move template_preprocess, _template_preprocess_default_variables into services (Probably ThemeManager or invoked via that.)'

Proposed resolution

Move template_preprocess() and _template_preprocess_default_variables() to ThemeManager class.

Remaining tasks

  • Make reviews
  • Decide if we need to deprecate theme_preprocess() or can we simply remove it

User interface changes

None.

API changes

theme_preprocess() should be removed. I think nobody should use theme_preprocess() anywhere in contrib. Other option is to deprecate it. This need to be decided before merging this in.

Data model changes

None.

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Theme 

Last updated 15 minutes ago

Created by

🇩🇪Germany dawehner

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024