--- old\modules\taxonomy_access\taxonomy_access.module Sun Jan 15 17:56:45 2006 +++ new\modules\taxonomy_access\taxonomy_access.module Mon Jan 16 09:50:01 2006 @@ -511,7 +511,6 @@ case 'insert': // Determine the category/categories the new node was assigned to $tids = $node->taxonomy; - db_query('DELETE FROM {node_access} WHERE nid = %d AND realm = \'term_access\'', $node->nid); // For nodes not assigned to a category if (!$tids) { $query = db_query("SELECT * FROM {term_access} where tid = '0'"); @@ -522,6 +521,19 @@ } // For nodes assigned to a category else { + $tids = array(); + foreach ($node->taxonomy as $k1) { + if (is_array($k1)) { + foreach ($k1 as $k2) { + if ($k2) { + $tids[] = $k2; + } + } + } + else if ($k1) { + $tids[] = $k1; + } + } // Query the term_access table to get the permissions for the new node's assigned category/categories // then make appropriate changes to the node_access table. $result = db_query("SELECT rid, BIT_OR(grant_view) AS grant_view, BIT_OR(grant_update) AS grant_update, BIT_OR(grant_delete) AS grant_delete FROM {term_access} WHERE tid IN ('".implode("','",array_values($tids))."') GROUP BY rid");