Replace tokens in eca_workflow_transition revision_log

Created on 11 March 2025, 22 days ago

Problem/Motivation

In \Drupal\eca_content\Plugin\Action\SetNewRevision::execute(), we allow administrators to use tokens when setting the node's revision log message...

$log = $this->tokenService->replace($this->configuration['revision_log']);
if ($log instanceof DataTransferObject) {
  $log = $log->getString();
}
if ($log) {
  $entity->setRevisionLogMessage($log);
}

However, we don't do that in \Drupal\eca_workflow\Plugin\Action\WorkflowTransition::execute()...

$entity->setRevisionLogMessage($this->configuration['revision_log']);

Proposed resolution

Replace tokens in the revision_log message in \Drupal\eca_workflow\Plugin\Action\WorkflowTransition::execute()

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit
  5. Release

User interface changes

Add '#eca_token_replacement' => TRUE, to the form field \Drupal\eca_workflow\Plugin\Action\WorkflowTransition::buildConfigurationForm() so that the UI states that "This field supports tokens."

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024