When there is a view that is partially splitted, and in the partial split a views handler needs to be removed, the handler does not get removed and appears as broken.
This happens in a multi-site where one handler is removed for specific site requirements.
- Create a view in default configuration
- Create a config split that marks this view as partial split.
- Remove a handler and export this change to the config split.
Now, import this new configuration in one of these:
- Other environment that does not have the new configuration
- The same environment but with the a database loaded that does not have this new configuration.
Implement hook_config_schema_info_alter so that the handler mapping schema has the 'plugin_id' as the patch index. Example with view sorts:
/**
* Implements hook_config_schema_info_alter().
*/
function mysite_config_config_schema_info_alter(&$definitions) {
if (isset($definitions['views_sort'])) {
$definitions['views_sort']['settings']['patch index'] = 'plugin_id';
}
}
With this, throw a exception into the mergeArray method at ConfigPatchMerge and capture it with a try/catch so that if a mapping configuration does not have its patch index, it gets removed from $result.
- Tests.
- Check if the config split generated patch contents are still correct, as the current solution only acts in the configuration import process and not in the configuration export.
Needs work
2.0
Code
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.