Warning: Undefined array key "render element" in ThemeManager when using matomo alert block

Created on 29 July 2025, about 1 month ago

Problem/Motivation

When enabling the Matomo Alert module and placing the Matomo Alert Block, the following warning appears on the page:

Warning: Undefined array key "render element" in Drupal\Core\Theme\ThemeManager->render() (line 202 of core/lib/Drupal/Core/Theme/ThemeManager.php).

This happens because the theme definition for matomo_alert_block is missing the 'render element' => 'element' key, which is required for custom block templates in Drupal.

Proposed resolution

To fix this warning, add the following line to the theme definition in matomo_alert_theme() inside matomo_alert.module:

'render element' => 'element',

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇪🇸Spain sergio.rizo

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