function statistics_update_8001

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

File

core/modules/statistics/statistics.install, line 64

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.