Field names need to be normalized

Created on 30 October 2024, about 2 months ago

Problem/Motivation

If a field name contains a character that is not allowed in (Twig) variable names it will result in an assertion error if evaluating assert() is not disabled. Otherwise it is available, but not usable as token.

See https://www.drupal.org/project/drupal/issues/3473064 🐛 Assertion error if field name could not be used as variable name Active .

Steps to reproduce

Create a view that is connected to an entity with a : in the field name.

Proposed resolution

Normalize field names by replacing any not allowed character with __ and log a warning in case of a duplicate. (Duplicates are not to be expected, though.)

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

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