You are here

function statistics_update_8001 in Drupal 8

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([
      '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.';
    }
  }
}