Problem/Motivation
While working on a site with Config Enforce, we noticed that Workflow Transitions and Labels were not being recognized as "enforceable", even though we were able to identify the relevant config entities through CE's "Generate from Active Storage" feature.
Digging into the problem, I noticed that the getEditableConfigNames() method from ConfigFormBaseTrait has a null implementation in Workflow's WorkflowConfigTransitionFormBase class, from which ConfigTransitionLabelForm and ConfigTransitionRoleForm are derived.
This results in Config Enforce not being able to recognize the config forms and pick up their config entities in context. I'm not aware of other implications, but presumably this missing/null implementation will create similar problems with other modules attempting to interact with Workflow's config entities.
Steps to reproduce
- Install a site with Config Enforce, Config Enforce Devel, and Workflow modules
- Create an example workflow entity, eg.
my_workflow - Go to
/admin/config/workflow/workflow/my_workflow/transition_roles, and notice the usual Config Enforce form is missing - Go to
/admin/config/workflow/workflow/my_workflow/transition_labels, and notice the usual Config Enforce form is missing
Proposed resolution
Implement getEditableConfigNames in both ConfigTransitionLabelForm and ConfigTransitionRoleForm classes, by using the associated Workflow entity's getStates() and getTransitions methods to iterate over Transitions and collect config names for the associated entities.
Remaining tasks
Roll a patch
User interface changes
None, except the Config Enforce form will appear as usual on the associated config forms.
API changes
More complete implementation of the ConfigFormBase API.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | workflow-implement_geteditableconfignames-3352388-2.patch | 1.63 KB | spiderman |
Issue fork workflow-3352388
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3352388-implement-geteditableconfignames-for
changes, plain diff MR !9
Comments
Comment #3
spidermanI've pushed a patch on the issue fork that implements the getEditableConfigNames method on both classes.
Comment #4
spidermanI've attached a static patch of the MR as it stands right now, for inclusion in composer.json.
Comment #6
johnvThanks, committed from patch.
Also removed the stub function in the parent class.
Not sure how to handle, close, MR.
Comment #8
spidermanThat's great, thanks!