function update_fix_compatibility

update_fix_compatibility()

Disables any extensions that are incompatible with the current core version.

File

core/includes/update.inc, line 17
Drupal database update API.

Code

function update_fix_compatibility() {
  $extension_config = \Drupal::configFactory()->getEditable('core.extension');
  $save = FALSE;
  foreach (array('module', 'theme') as $type) {
    foreach ($extension_config->get($type) as $name => $weight) {
      if (update_check_incompatibility($name, $type)) {
        $extension_config->clear("$type.$name");
        $save = TRUE;
      }
    }
  }
  if ($save) {
    $extension_config->set('module', module_config_sort($extension_config->get('module')));
    $extension_config->save();
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!update.inc/function/update_fix_compatibility/8.1.x