ECA Render: Not possible to use markup within render arrays of some elements

Created on 27 September 2025, 21 days ago

Problem/Motivation

There are occasions where it is useful to insert links or other markup into render elements that escape input strings by default. In code, you would do this by wrapping the markup string with a TranslatableMarkup or FormattableMarkup object, but in ECA there is no equivalent.

The ECA Render: Markup action generates a Markup object, but wraps it in a render array, making it impossible to use it inside of other render arrays (as this results in a "0 is not a valid render array key" error).
Even if it does work, it seems to require a very cumbersome approach of constructing a render array one key at a time (using "Token: set value" or "List: add item") just so that the Markup objects can be inserted without getting casted into strings by the yaml parser.

Steps to reproduce

  1. Create a model
  2. Add event "Render: ECA entity"
  3. Add action "Render: build"
  4. Configure action with the following values:
    Value:
    '#theme': 'status_messages'
    '#message_list':
      'status':
        - '<strong>hello!</strong>'

    Interpret above value as YAML format: yes

  5. View a node and observe that the HTML tags in the added element have been escaped.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

3.0

Component

Code

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