Problem/Motivation
I am working on implementing an action plugin over in social post mastodon:
https://www.drupal.org/project/social_post_mastodon/issues/3535066
β¨
Integrate with ECA
Active
Here is a direct link to the action: https://git.drupalcode.org/issue/social_post_mastodon-3535066/-/blob/353...
This action still needs some work, but this behavior is still unexpected.
My plan is to utilize token replacement for both user id and message configuration fields on my action. Initially, I attempted to add tokens to my field by clicking on the field and then on the token like I normally do elsewhere in Drupal. I first found that the token would not go into the field. I poked around the eca module and found that some of the actions that were designed with tokens in mind have this property on the field:
'#eca_token_replacement' => TRUE,
By adding that, I was able to add tokens to my field by clicking on them. Excellent. But my next issue, was that when I click save, or click out of the task contains my configurable action, and then go back into my task, I see that the token I added to my field is gone.
For a little bit, I thought I was doing something wrong in my action, but I have found that this behavior is not unique to my action. I have noticed that while I cannot add tokens to fields that do not have this property, if i manually type the token into such a field field, then it will save properly.
I would like to have my cake and eat it too.
Steps to reproduce
Add a token to a field with the property mentioned above, click outside of the task (or save and reload the page), and click back into it. See that the token is gone.