Missing FormattableMarkup in Render Element class

Created on 28 October 2024, about 2 months ago

Problem/Motivation

When encountering an error where ""@key" is an invalid render array key" it fails because the namespace of Formattable Markup is missing

This is the error encountered instead:

Error: Class "Drupal\Core\Render\FormattableMarkup" not found in Drupal\Core\Render\Element::children() (line 98 of core/lib/Drupal/Core/Render/Element.php).

Steps to reproduce

Render an element array with an invalid key

Proposed resolution

Just needs the use statement in the file
use Drupal\Component\Render\FormattableMarkup;

Seems like it may be replaced by https://www.drupal.org/project/drupal/issues/2552163 β†’ but for now this is a bug in the current version

πŸ› Bug report
Status

Active

Version

10.3 ✨

Component

render system

Created by

πŸ‡ΊπŸ‡ΈUnited States EHLOVader

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

Comments & Activities

Production build 0.71.5 2024