Problem/Motivation

We currently have a single global list of enforced configs. This currently breaks if it contains an enforced config in a target module that isn't yet enabled. More importantly, while the current functionality is handy for site builders, it should also prove quite useful for module maintainers.

Steps to reproduce

Create a target module and save some config into it. Disabling the module will then cause errors.

Proposed resolution

Split up config_enforce.enforced_configs.yml into multiple config_enforce.<module_name>.enforced_configs.yml

Remaining tasks

  1. Write enforced config settings into target-module-specific configs
  2. Compile enforced configs list from all target modules.

User interface changes

None.

API changes

API changes should be minimal and isolated to the ConfigEnforce and ConfigEnforceDevel classes, which handle reading and writing enforced configs.

Data model changes

The overall data model remains mostly unchanged, but the config storage will be altered. We may be able to remove a couple keys from storage, as the module name (at least), should be easy to populate from context.

We'll may also want to add a key to target module info.yml files to more easily identify them

Comments

ergonlogic created an issue. See original summary.

ergonlogic’s picture

Issue summary: View changes

  • ergonlogic committed a4513b2 on 1.0.x
    Issue #3169242: Allow target modules to define their own enforced...
ergonlogic’s picture

Status: Active » Fixed

This is working nicely. We now initialize a config_enforce.enforced_configs.<module_name>.yml config file when we create a new target module. The enforcement settings for enforced configs are, themselves, treated as a special case in embedded forms, and made read-only. Basically, this is because they can't logically be moved out of their associated target module.

ergonlogic’s picture

Interestingly, since multiple configs now go into populating the enforced configs page, we now have an example of getEditableConfigNames() returning more than one item.

  • ergonlogic committed 2193fa7 on 1.0.x
    Issue #3169242: Refactor target module creation.
    

  • ergonlogic committed 76cfb26 on 1.0.x
    Issue #3169242: Clean up stale enforced config that is moving to another...
  • ergonlogic committed c87db29 on 1.0.x
    Issue #3169242: Disable enforced_configs rows of form table, since they'...

  • ergonlogic committed 16ab93a on 1.0.x
    Issue #3169242: Begin refactoring of target modules handling into a...
  • ergonlogic committed 49e7b42 on 1.0.x
    Issue #3169242: Generate a default target module if none exists.
    
  • ergonlogic committed 4c089bd on 1.0.x
    Issue #3169242: Set default target module if any exist.
    
  • ergonlogic committed 89a1590 on 1.0.x
    Issue #3169242: Determine available target modules by scanning relevant...
  • ergonlogic committed c0458c5 on 1.0.x
    Issue #3169242: Begin refactoring of enforced configs into a stand-alone...
  • ergonlogic committed c081f4e on 1.0.x
    Issue #3169242: Block default target module from being unregistered.
    

Status: Fixed » Closed (fixed)

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