You are here

function taxonomy_access_vocabulary_delete_submit in Taxonomy Access Control 6

Submit handler for vocabulary deletions. Overrides vocab deletion handling to determine what node access to update.

1 string reference to 'taxonomy_access_vocabulary_delete_submit'
taxonomy_access_form_taxonomy_vocabulary_confirm_delete_alter in ./taxonomy_access.module
Implements hook_form_FORM_ID_alter() for taxonomy-vocabulary-confirm-delete. Overriding the vocabulary deletion form's submit handler allows us to determine which {node_access} entries must be updated before the {term_data} and {term_node}…

File

./taxonomy_access.module, line 296
Allows administrators to specify how each category (in the taxonomy) can be used by various roles.

Code

function taxonomy_access_vocabulary_delete_submit(&$form, &$form_state) {
  $vid = $form_state['values']['vid'];
  _taxonomy_access_del_vocabulary($vid);

  // Determine which nodes belong to this vocabulary and cache.
  $affected_nodes = _taxonomy_access_get_nodes_for_vocabulary($vid);
  _taxonomy_access_cache_affected_nodes($affected_nodes);

  // Proceed with vocabulary deletion.
  return taxonomy_vocabulary_confirm_delete_submit($form, $form_state);
}