You are here

function taxonomy_access_update_5 in Taxonomy Access Control 5.2

Same name and namespace in other branches
  1. 6 taxonomy_access.install \taxonomy_access_update_5()

File

./taxonomy_access.install, line 65

Code

function taxonomy_access_update_5() {
  $result = db_query('SELECT rid, grant_view, grant_update, grant_delete, grant_create, grant_list FROM {term_access} WHERE tid=0');
  while ($row = db_fetch_array($result)) {
    if ($row['rid'] > 0) {

      // just in case we have a weird row with 0, 0
      db_query('INSERT INTO {term_access_defaults} (vid, rid, grant_view, grant_update, grant_delete, grant_create, grant_list) VALUES(0, %d, %d, %d, %d, %d, %d)', $row);
    }
  }
  db_query('DELETE FROM {term_access} WHERE tid=0');
  return array();
}