function node_uninstall

Implements hook_uninstall().

See also

node_ranking()

_node_rankings()

File

drupal/core/modules/node/node.install, line 510
Install, update and uninstall functions for the node module.

Code

function node_uninstall() {

  // Delete node type variables.
  $types = db_query('SELECT type FROM {node_type}')
    ->fetchCol();
  foreach ($types as $type) {
    db_delete('variable')
      ->condition(db_or()
      ->condition('name', 'node_preview_' . $type)
      ->condition('name', 'node_options_' . $type)
      ->condition('name', 'node_submitted_' . $type)
      ->condition('name', 'node_permissions_' . $type)
      ->condition('name', 'node_type_language_translation_enabled_' . $type))
      ->execute();
    config('language.settings')
      ->clear('node. ' . $type . '.language.default_configuration')
      ->save();
  }

  // Delete node search ranking variables.
  variable_del('node_rank_relevance');
  variable_del('node_rank_sticky');
  variable_del('node_rank_promote');
  variable_del('node_rank_recent');

  // Delete remaining general module variables.
  Drupal::state()
    ->delete('node.node_access_needs_rebuild');
  variable_del('node_admin_theme');
  variable_del('node_recent_block_count');

  // Delete any stored state.
  Drupal::state()
    ->delete('node.cron_last');
}