Fields in plugin configuration forms can have 2 special relationships with tokens: either they support token replacements or they expect a token name. For both cases, ECA introduces a form API property, that tells ECA which of the 2 features is being supported by a field:
"#eca_token_replacement" => TRUE: this property indicates that this field supports token replacement"#eca_token_reference" => TRUE: this property indicates that this field expects a token name
For details about token vs token names, please refer to the token chapter in the ECA Guide.
This change is important for developers as they are asked to mark all config fields accordingly, and at the same time, remove any potential explanation from field descriptions. This is because ECA adds common descriptions automatically following the 2 new properties. That helps to provide a more consistent UI where the description is always the same for the same functionality.
Examples:
$form['key'] = [
'#type' => 'textfield',
'#title' => $this->t('State key'),
'#default_value' => $this->configuration['key'],
'#weight' => -20,
'#description' => $this->t('The key of the Drupal state.'),
'#eca_token_replacement' => TRUE,
];
$form['token_name'] = [
'#type' => 'textfield',
'#title' => $this->t('Name of token'),
'#default_value' => $this->configuration['token_name'],
'#weight' => -10,
'#description' => $this->t('The name of the token, the value is stored into.'),
'#eca_token_reference' => TRUE,
];