“Form field: exists” condition does not support tokens

Created on 29 November 2023, about 1 year ago
Updated 7 March 2024, 11 months ago

Problem/Motivation

I am trying to check if a form field exists on the user edit form by using the “Form field: exists” condition. The field name property for the condition says it supports tokens but when I try using a token as the form field name it does not work.

Steps to reproduce

See attached minimal reproduction of issue.

Proposed resolution

From jurgenhaas in Slack channel:

The action uses \Drupal\eca\Plugin\FormFieldPluginTrait::getFieldNameAsArray which doesn't replace tokens. We may have to provide an optional argument to that function that it should do otherwise, but keep the current behavior by default.

Remaining tasks

  1. Decide on solution.
  2. Implement solution.
  3. Write test to validate solution.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States pcate

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

Comments & Activities

Production build 0.71.5 2024