“Form field: exists” condition does not support tokens

Issue information

From user: pcate

Contribution record

Fork management

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

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information