You are here

function statistics_update_8001 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/statistics/statistics.install \statistics_update_8001()

Disable the Statistics module if the node module is not enabled.

File

core/modules/statistics/statistics.install, line 64
Install and update functions for the Statistics module.

Code

function statistics_update_8001() {
  if (!\Drupal::moduleHandler()
    ->moduleExists('node')) {
    if (\Drupal::service('module_installer')
      ->uninstall(array(
      'statistics',
    ), TRUE)) {
      return 'The statistics module depends on the node module and has therefore been uninstalled.';
    }
    else {
      return 'There was an error uninstalling the statistcs module.';
    }
  }
}