function node_modules_uninstalled

Same name in other branches
  1. 7.x modules/node/node.module \node_modules_uninstalled()
  2. 9 core/modules/node/node.module \node_modules_uninstalled()
  3. 8.9.x core/modules/node/node.module \node_modules_uninstalled()

Implements hook_modules_uninstalled().

File

core/modules/node/node.module, line 1247

Code

function node_modules_uninstalled($modules) {
    // Check whether any of the disabled modules implemented hook_node_grants(),
    // in which case the node access table needs to be rebuilt.
    foreach ($modules as $module) {
        // At this point, the module is already disabled, but its code is still
        // loaded in memory. Module functions must no longer be called. We only
        // check whether a hook implementation function exists and do not invoke it.
        // Node access also needs to be rebuilt if language module is disabled to
        // remove any language-specific grants.
        if (!node_access_needs_rebuild() && (\Drupal::moduleHandler()->hasImplementations('node_grants', $module) || $module == 'language')) {
            node_access_needs_rebuild(TRUE);
        }
    }
    // If there remains no more node_access module, rebuilding will be
    // straightforward, we can do it right now.
    if (node_access_needs_rebuild() && !\Drupal::moduleHandler()->hasImplementations('node_grants')) {
        node_access_rebuild();
    }
}

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