You are here

function answers_uninstall in Answers 8

Same name and namespace in other branches
  1. 5.2 answers.install \answers_uninstall()
  2. 6.2 answers.install \answers_uninstall()
  3. 7.4 answers.install \answers_uninstall()
  4. 7.3 answers.install \answers_uninstall()

Implements hook_uninstall().

File

./answers.install, line 33
Install, update, and uninstall functions for the Answers module.

Code

function answers_uninstall() {
  if ($field_storage = FieldStorageConfig::loadByName('node', 'answers_related_question')) {
    $field_storage
      ->delete();
  }

  // Purge field data now to allow taxonomy and options module to be uninstalled
  // if this is the only field remaining.
  field_purge_batch(10);

  // Allow locked_content_type to be deleted.
  $locked = Drupal::state()
    ->get('node.type.locked');
  unset($locked['answers_question']);
  unset($locked['answers_answer']);
  Drupal::state()
    ->set('node.type.locked', $locked);
}