Problem

Sometimes after delivering a site, you want to be able to lock the config so that it can't be changed without going through the dev process.

Solution

Offer the ability to 'lock' configuration against any changes. This would mean anything which changes config (like the admin UI) would simply have not effect. Ideally there would be visual cues to the user that this is true. This settings should not live in the admin itself, but rather should be set in a config variable with no UI, or in settings.php. If config is locked, imports should still be able to take place.

Even if we don't build this into core, we should ensure there is a way for contrib to hook in to provide such a feature - see https://www.drupal.org/project/config_readonly

Comments

heyrocker’s picture

Issue tags: +Configuration system

Tagging

heyrocker’s picture

I'd still like to do this in a very simple way.

1) Set a $conf/$settings variable 'lock_config'.
2) In Config::save() if lock_config is TRUE then bail.

It wouldn't be surfaced in the UI at all, but it would do the job. We could potentially add a drupal_set_message() warning saying 'The system is in read only mode' on admin pages. What I'd really like is to set all form elements to read only if this setting is on, but I'm not sure of the possibility of that.

heyrocker’s picture

See also #1831928: Support a 'locked' property on ConfigEntities, although that is only for ConfigEntities

alexpott’s picture

Version: 8.x-dev » 9.x-dev

Punting

heyrocker’s picture

I am fine with punting this as long as we offer a way for contrib to do it, which afaik we currently don't.

heyrocker’s picture

Issue summary: View changes

Updated issue summary.

catch’s picture

Version: 9.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Active » Postponed
tkoleary’s picture

Added to config management usability meta #2642404

beejeebus’s picture

was thinking of working on this - why is it postponed?

jibran’s picture

Status: Postponed » Active

why is it postponed?

Because 8.0.0 was not tagged then. It is tagged now so back to active.

xjm’s picture

alexpott’s picture

beejeebus’s picture

@alexpott - i'm just making sure config_readonly works, seems it will be fine with a few bug fixes. do you have any thoughts on facilities we can add to core to make config_readonly work better? or can we leave this issue as is, and just suggest people install that module?

pwolanin’s picture

seems ok for now to point to contrib - if that becomes popular we can add it to core as a feature in e.g. 8.2.x?

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.