Disables any extensions that are incompatible with the current core version.
function update_fix_compatibility() {
foreach (array(
'module',
'theme',
) as $type) {
$config = config("system.{$type}");
$save = FALSE;
foreach ($config
->get('enabled') as $name => $weight) {
if (update_check_incompatibility($name, $type)) {
$config
->clear("enabled.{$name}");
$save = TRUE;
}
}
if ($save) {
if ($type == 'module') {
$config
->set('enabled', module_config_sort($config
->get('enabled')));
}
$config
->save();
}
}
}