Skip to content
Snippets Groups Projects
Commit 60ab6036 authored by Tim Steiner's avatar Tim Steiner
Browse files

Clear out old TAC records when the selected vocab is changed.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@195 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent a87926e2
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,8 @@ function theme_tac_term_list($variables)
function tac_admin_submit($form, &$form_state)
{
db_delete('tac_map')->execute();
$vocabulary = $form_state['values']['vocabulary'];
if ($vocabulary > 0 && $vocabulary != variable_get('tac_vocabulary')) {
variable_set('tac_vocabulary', $vocabulary);
......@@ -103,7 +105,6 @@ function tac_admin_submit($form, &$form_state)
}
db_delete('tac_map')->execute();
$insert = db_insert('tac_map')->fields(array('rid', 'tid', 'grant_view', 'grant_update', 'grant_delete'));
foreach ($form_state['values']['edit'] as $rid => $terms) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment