“Form field: exists” condition does not support tokens
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::getFieldNameAsArraywhich 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
- Decide on solution.
- Implement solution.
- Write test to validate solution.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Edited by drupalbot