You are here

function file_download_counter_update_8001 in File Download 8

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

File

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

Code

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