After uninstall, there're errors in admin/reports/fields:

•Notice: Undefined index: comment_node_biblio in _field_ui_bundle_admin_path() (line 325 of drupal\modules\field_ui\field_ui.module).
•Notice: Undefined index: comment_node_biblio in field_ui_fields_list() (line 35 of drupal\modules\field_ui\field_ui.admin.inc).
•Notice: Undefined index: biblio in _field_ui_bundle_admin_path() (line 325 of drupal\modules\field_ui\field_ui.module).
•Notice: Undefined index: biblio in field_ui_fields_list() (line 35 of drupal\modules\field_ui\field_ui.admin.inc).

Comments

loopduplicate’s picture

Issue summary: View changes

This is how I fixed the problem. Hope it helps someone.
-Jeff

  // Biblio Node fields.
  $field_instances = field_info_instances('node', 'biblio');
  foreach ($field_instances as $instance) {
    field_delete_instance($instance);
  }

  // Biblio Comment fields.
  $field_instances = field_info_instances('comment', 'comment_node_biblio');
  foreach ($field_instances as $instance) {
    field_delete_instance($instance);
  }
  

menuchin’s picture

Comment obsolete.

gippy’s picture

Thank you loopduplicate. Your code cleanly removed the data that was causing the error messages. For those of you who are not sure how to implement loopduplicate's suggestion, here is how you can run loopduplicate's code:

1. Reinstall the biblio module and enable it.
2. Add loopduplicate's code to the biblio.install module as shown shown below.
3. deactivate the biblio module
4. uninstall the biblio module

function biblio_batch_uninstall_finished($success, $results, $operations) {
  if ($success) {
//TODO taxonomy
/*
    if (module_exists('taxonomy')) {
      $voc = taxonomy_get_vocabularies();
      foreach ($voc as $vid => $vocabulary) {
        if ($vocabulary->module == 'biblio')  taxonomy_del_vocabulary($vid);
      }
    }
*/
    $vars = db_query("SELECT * FROM {variable} WHERE name LIKE 'biblio_%'");
    foreach ($vars as $var) {
      variable_del($var->name);
    }

    // Biblio Node fields.
    $field_instances = field_info_instances('node', 'biblio');
    foreach ($field_instances as $instance) {
      field_delete_instance($instance);
    }

    // Biblio Comment fields.
    $field_instances = field_info_instances('comment', 'comment_node_biblio');
    foreach ($field_instances as $instance) {
      field_delete_instance($instance);
    }

  }
}
loopduplicate’s picture

Nice, thanks Gippy! :)

rupesh_jagtap’s picture

Status: Active » Closed (fixed)