I've come across a number of instances where I've wanted specific configuration entities to be ignored during configuration import operations. Our current workflow basically involves full config exports from local dev environments that get get imported to dev, staging, production environments. Most recently, using the YamlForm module I ran up against this again where I wanted certain YamlForm "template" forms (which are config entities) to get imported into production but also have forms that get spawned from these templates to get ignored during configuration import so they wouldn't get deleted when importing configurations that didn't contain the spawned entities. drush cim --partial
was a potential workaround but introduced other issues into our workflow.
This patch lays groundwork in core for flagging individual configuration entities to be ignored during config imports allowing more flexibility in configuration workflows. Using YamlForm as an example, a YamlForm configuration entity can be created and set to be ignored by configuration like so:
$yamlForm = YamlForm::create($values);
$yamlForm->setImportIgnore(TRUE);
$yamlForm->save();
setImportIgnore()
also has an option for making the ignore settings for the entity more granular by import operation (create, update, rename, or delete):
// Ignore config import for creation and updating only.
$yamlForm->setImportIgnore(TRUE, ['create', 'update']);
Having config import ignore flags set will prevent an entity's config from getting imported as well as prevent it from showing up in change lists.