Problem/Motivation

A potential use case for config revisions is to manage specific configuration types or items on a per-entity basis. For example, if you're using the Group module, you might want a different version of an "entity view display" configuration per group.

Proposed resolution

This could be either a submodule of Config Revision or a stand-alone project.

There are a couple of core APIs that might apply here: context and condition (condition plugins as used for example in configuring where/when a block is visible). Of these, contexts are probably more flexible. Following the per-group layout builder config example, it could work something like this:

  • On the Config Revisions Settings form, for each enabled configuration type, provide a configuration form that allows selection of a context to associate with the configuration type. In this example, for the "entity view display" config type, we might select the "Group from URL" (group) context.
  • When that selection is saved, a new config revision bundle is created for the condition type with a field to store the value of the group context.
  • Subsequently, when and an entity of type "entity view display" is saved while the group context is active, a revision is saved specific to that context. For example, if I edit the entity view display for group 123, the result is saved to a revision that includes a reference to that group.
  • When configuration is loaded and a config revisions context is selected for the configuration type and there is a previously-created revision matching the current context value, that revision is loaded.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

nedjo created an issue.