Allow the local task title to be altered through hook_local_tasks_alter()
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3067572. --> Reported by: [idebr](https://www.drupal.org/user/1879760) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The Scheduled Transitions module supplies a local task to the Scheduled transitions overview page. The local task title is dynamic based on the number of scheduled transitions. This is implemented in <code>\Drupal\scheduled_transitions\Plugin\Menu\LocalTask\ScheduledTransitionsLocalTask::getTitle()</code>. </p> <p>However, the <code>getTitle()</code> ignore the title previously set in <code>\Drupal\scheduled_transitions\Plugin\Derivative\ScheduledTransitionsLocalTasks::getDerivativeDefinitions()</code>, so it also does not pick up any overrides from <code>hook_local_tasks_alter()</code>.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add the dynamic count of scheduled transitions to the plugin definition title instead of hardcoding the 'Scheduled transitions' string. This allows the title to be overridden through <code>hook_local_tasks_alter()</code>.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ol> <li>Write a patch</li> <li>Review</li> <li>Commit</li> </ol> <h3 id="summary-ui-changes">User interface changes</h3> <p>None.</p> <h3 id="summary-api-changes">API changes</h3> <p>The title of the 'Scheduled transitions' tab can now be overridden through <code>hook_local_tasks_alter()</code>.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None.</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>The title of the 'Scheduled transitions' tab can now be overridden through <code>hook_local_tasks_alter()</code>.</p>
issue