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

  1. Install a site with Config Enforce, Config Enforce Devel, and Workflow modules
  2. Create an example workflow entity, eg. my_workflow
  3. Go to /admin/config/workflow/workflow/my_workflow/transition_roles, and notice the usual Config Enforce form is missing
  4. 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.

Issue fork workflow-3352388

Command icon 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:

Comments

spiderman created an issue. See original summary.

spiderman’s picture

Assigned: spiderman » Unassigned
Status: Active » Needs review

I've pushed a patch on the issue fork that implements the getEditableConfigNames method on both classes.

spiderman’s picture

I've attached a static patch of the MR as it stands right now, for inclusion in composer.json.

  • johnv committed 6cce8293 on 8.x-1.x authored by spiderman
    Issue #3352388 by spiderman: Implement getEditableConfigNames for...
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.7
Status: Needs review » Fixed

Thanks, committed from patch.
Also removed the stub function in the parent class.
Not sure how to handle, close, MR.

spiderman’s picture

That's great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.