Undefined array key "type" in Drupal\Core\Theme\ThemeManager->render()

Created on 4 July 2024, 6 months ago
Updated 18 September 2024, 3 months ago

Problem/Motivation

Found two warnings in dblog

Warning: Undefined array key "type" in Drupal\Core\Theme\ThemeManager->render() (Zeile 292 in html/core/lib/Drupal/Core/Theme/ThemeManager.php).:

Warning: Undefined array key "template" in Drupal\Core\Theme\ThemeManager->render() (Zeile 333 in html/core/lib/Drupal/Core/Theme/ThemeManager.php).:

Steps to reproduce

Don't remove from /html/sites/development.services.yml

  twig.config:
    debug: true
    auto_reload: true

part.

Proposed resolution

Use admin/config/development/settings instead

🐛 Bug report
Status

Postponed: needs info

Version

11.0 🔥

Component
Theme 

Last updated about 1 hour ago

Created by

🇨🇦Canada djdemonNet

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

Comments & Activities

  • Issue created by @djdemonNet
  • 🇳🇿New Zealand quietone

    Fixes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies. Also, 10.2 is in security mode now.

  • Status changed to Postponed: needs info 5 months ago
  • 🇮🇳India samit.310@gmail.com

    Hi @dmytro.chornyi,

    I verified it both in 10.2.x and 11.x, i am not able to reproduce it at my end, I added following code in sites/development.services.yml

    twig.config:
        debug: true
        auto_reload: true
    

    Also checked all the check-boxes on admin/config/development/settings page. Adding screenshot for the reference.

    It might me the Theme issue. Can you please share all the details like the theme name etc.

    Thanks
    Samit K.

  • 🇮🇳India malhar_c

    Don't know if this is relevant but here's a quick fix that worked for me. I'm on Drupal 10.3.1 though, and I faced this exact warning while customising the default user login page using hook_theme_suggestions_alter() and hook_theme_registry_alter(), but this might help others as well, if you are in similar endeavour.

    <?php
    $theme_registry['page__custom_page']['type'] = 'base_theme_engine';

    Setting the type key for the theme suggestion directly in the theme registry resolves it.

    Cheers :)
    Malhar

Production build 0.71.5 2024