Module provided templates can only render with Twig

Created on 19 November 2024, about 1 month ago

Problem/Motivation

In \Drupal\Core\Theme\ThemeManager::render there is a condition that prevents module-originated templates from being processed with a different render_template

if (isset($theme_engine)) {
      if ($info['type'] != 'module') { // <<<< THIS CONDITION
        if (function_exists($theme_engine . '_render_template')) {
          $render_function = $theme_engine . '_render_template';
        }
        $extension_function = $theme_engine . '_extension';
        if (function_exists($extension_function)) {
          $extension = $extension_function();
        }
      }
    }

This interferes with Experience Builder's templates being able to render with a different theme engine. There's a workaround RN, but it's clunky and any additional module hoping to do this would also need to add it.

Based on looking at the commit history and talking to some long time core contributors, there's a good chance this is just an artifact from drupal <=7 and not something essential. Lets find out!

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.1 πŸ”₯

Component

theme system

Created by

πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024