You are here

function quiz_ddlines_uninstall in Quiz 8.4

Same name and namespace in other branches
  1. 7.4 question_types/quiz_ddlines/quiz_ddlines.install \quiz_ddlines_uninstall()

Implements hook_uninstall().

File

question_types/quiz_ddlines/quiz_ddlines.install, line 135
Sponsored by: Senter for IKT i utdanningen Code: paalj

Code

function quiz_ddlines_uninstall() {

  // Delete instance:
  $field_instance = \Drupal\field\Field::fieldInfo()
    ->getInstance('node', 'field_image', 'quiz_ddlines');
  if ($field_instance) {
    $field_instance
      ->delete();
  }

  // Purge field data now to allow taxonomy and options module to be uninstalled
  // if this is the only field remaining. We need to run it twice because
  // field_purge_batch() will not remove the instance and the field in the same
  // pass.
  field_purge_batch(10);
  field_purge_batch(10);
  drupal_set_message(t("The Quiz drag and drop module has been uninstalled. Nodes of this type may still exist, but they will not function properly."));
}