InvalidArgumentException if YAML contains custom tag

Created on 18 September 2025, 2 days ago

Problem/Motivation

YAML allows custom tags: https://symfony.com/doc/current/components/yaml.html#parsing-and-dumping...
I don't think this is useful in webform but it makes the edit form crash:

InvalidArgumentException:
"foo" is an invalid render array key. Value should be an array but got a object.

  at core/lib/Drupal/Core/Render/Element.php:97
  at Drupal\Core\Render\Element::children()
     (modules/contrib/webform/src/WebformEntityElementsForm.php:234)
  at Drupal\webform\WebformEntityElementsForm->addWebformTypePrefixRecursive()
     (modules/contrib/webform/src/WebformEntityElementsForm.php:216)

Steps to reproduce

Don't enable webform_ui.
Browse to /admin/structure/webform/manage/[webform_id].
Save this YAML:

foo: !my_tag { foo: bar }

Proposed resolution

This error should be handled more gracefully.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

6.3

Component

Code

Created by

πŸ‡«πŸ‡·France prudloff Lille

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

Merge Requests

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