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
- Write enforced config settings into target-module-specific configs
- 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
Comment #2
ergonlogicComment #4
ergonlogicThis is working nicely. We now initialize a
config_enforce.enforced_configs.<module_name>.ymlconfig 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.Comment #5
ergonlogicInterestingly, since multiple configs now go into populating the enforced configs page, we now have an example of
getEditableConfigNames()returning more than one item.