Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Let WorkflowManager and WorkflowGroupManager call alter hook on plugin discovery, so other modules can act on this.
Comment | File | Size | Author |
---|---|---|---|
#5 | implement_alter_hooks-2982653-5.patch | 1.86 KB | uniquename |
#2 | implement_alter_hooks-2982653-2.patch | 1.83 KB | uniquename |
Comments
Comment #2
uniquename CreditAttribution: uniquename commentedFind a patch attached that works for me.
Comment #3
uniquename CreditAttribution: uniquename commentedComment #4
joachim CreditAttribution: joachim as a volunteer commentedI'm not sure about this.
AFAICT, core doesn't provide alter hooks for YML-based plugins -- at least, I can't spot them for menu tasks and actions.
Docs don't match the param.
Same.
Comment #5
uniquename CreditAttribution: uniquename as a volunteer commentedThere is one in core/lib/Drupal/Core/Menu/LocalTaskManager.php Line 140.
I needed a way, to act on new workflows beeing installed and this was a propper way for me to achieve this.
Ups, fixed the docs...
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedLet's proceed with adding these alter hooks.
Looked at core YAML plugins, alter hooks are provided for breakpoints, local actions, local tasks, contextual links, config translation mappers.
They are not provided only for layouts.
I would personally prefer if people didn't alter workflows, but the Drupal philosophy was never about preventing you from shooting yourself in the foot.
Let's remove "plugins" from the alter hook names though, core only has that naming for contextual links.
So we'd have hook_workflows_alter() and hook_workflow_groups_alter().
Comment #8
bojanz CreditAttribution: bojanz at Centarro commentedTweaked and committed. Thanks!