Allow configs to be enforced by default

Created on 11 April 2025, 13 days ago

Problem/Motivation

I often forget to enforce relevant configs, since you explicitly have to flag them for enforcement. For example, when I add a new field, I might remember to enforce the field storage and instance settings, but to enforce form and view display settings.

It'd be nice to be able to automatically enforce all configs from any config forms that I've saved.

Proposed resolution

We could add a global setting to enforce configs by default. That way, when we interact with any new config form, the "enforce config" checkbox will be checked, and we won't have to remember to do so. Once we've worked out the kinks, I'd even suggest making that the default behaviour (maybe in v2).

One challenge here is that we assume that any config that is not stored in a target module registry is not enforced. When we load the config enforce form, how would we be able to differentiate between (a) not having yet interacted with this config, versus (b) having disabled enforcement for it? It doesn't even make sense to store such data in a target module registry (ie. which registry should be responsible for not enforcing the foo.bar config?)

I think the solution lies in leveraging our "unenforced configs" setting. When handling the submission of a config enforce form, if (and only if) we're enforcing by default, we can add the related config to config_enforce_devel.settings.ignored_configs. This setting currently has no effect on the CED form itself. However, when building the form (and we're enforcing by default), we could disable the "enforce" checkbox, if the related config is in ignored_configs.

Remaining tasks

TBD

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada ergonlogic Montréal, Québec 🇨🇦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024