? taxonomy_access-PHP_E_ALL_cleanup.patch
? taxonomy_access-code_style_cleanup-20091005.patch
Index: taxonomy_access.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access.install,v
retrieving revision 1.9.2.1
diff -u -p -r1.9.2.1 taxonomy_access.install
--- taxonomy_access.install	15 May 2009 01:11:05 -0000	1.9.2.1
+++ taxonomy_access.install	5 Oct 2009 03:24:30 -0000
@@ -2,6 +2,7 @@
 // $Id: taxonomy_access.install,v 1.9.2.1 2009/05/15 01:11:05 cpugeniusmv Exp $
 
 /**
+ * @file
  *  Implementations of hook_update (called by update.php)
  */
 
Index: taxonomy_access.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access.module,v
retrieving revision 1.107.2.7
diff -u -p -r1.107.2.7 taxonomy_access.module
--- taxonomy_access.module	15 May 2009 01:23:33 -0000	1.107.2.7
+++ taxonomy_access.module	5 Oct 2009 03:24:31 -0000
@@ -78,11 +78,11 @@ function taxonomy_access_enable() {
         'tar' => "SELECT ta.tid,ta.rid FROM {term_access} ta LEFT JOIN {role} r ON ta.rid = r.rid WHERE r.rid IS NULL",
         'tadr' => "SELECT tad.vid,tad.rid FROM {term_access_defaults} tad LEFT JOIN {role} r ON tad.rid = r.rid WHERE r.rid IS NULL"
       );
-      foreach($queries as $type => $sql) {
+      foreach ($queries as $type => $sql) {
         $result = db_query($sql);
-        while($args = db_fetch_array($result)) {
-          if($args) {
-            if($type == 'tax' || $type == 'tar') {
+        while ($args = db_fetch_array($result)) {
+          if ($args) {
+            if ($type == 'tax' || $type == 'tar') {
               db_query("DELETE FROM {term_access} WHERE tid = %d AND rid = %d", $args);
             }
             else {
@@ -367,6 +367,7 @@ function taxonomy_access_preserve_terms(
   // any other API call, the taxonomy API functions all use 
   // db_rewrite_sql() so we must query the database tables directly)
   $result = db_query('SELECT tid FROM {term_node} WHERE vid = %d', $node->vid);
+  $tids[$nid] = array();
   while ($row = db_fetch_array($result)) {
     // only include those terms the current user does not have access to
     if (!isset($user_terms[$row['tid']])) {
Index: taxonomy_access_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access_admin.inc,v
retrieving revision 1.15.2.3
diff -u -p -r1.15.2.3 taxonomy_access_admin.inc
--- taxonomy_access_admin.inc	29 Jul 2008 17:47:58 -0000	1.15.2.3
+++ taxonomy_access_admin.inc	5 Oct 2009 03:24:31 -0000
@@ -285,7 +285,7 @@ function taxonomy_access_admin_form_subm
   switch ($values['op']) {
   case t('Delete selected'):
     if (is_array($values['selected_terms'])) {
-      foreach($values['selected_terms'] as $tid => $enabled) {
+      foreach ($values['selected_terms'] as $tid => $enabled) {
         if ($enabled) {
           // issue #167977 - klance
           $affected_nodes = _taxonomy_access_get_nodes_for_term($tid);
@@ -296,7 +296,7 @@ function taxonomy_access_admin_form_subm
       }
     }
     if (is_array($values['selected_defaults'])) {
-      foreach($values['selected_defaults'] as $vid => $enabled) {
+      foreach ($values['selected_defaults'] as $vid => $enabled) {
         if ($enabled) {
           // issue #167977 - klance
           $affected_nodes = _taxonomy_access_get_nodes_for_vocabulary($vid, $values['rid']);
@@ -348,7 +348,7 @@ function taxonomy_access_admin_form_subm
  *   A hash of the grants in the form of $grants['perm'] = boolean
  *   A value of 1 will grant the permission for this user and term.
 **/
-function taxonomy_access_grant_update($tid, $rid = null, $grants = null) {
+function taxonomy_access_grant_update($tid, $rid = NULL, $grants = NULL) {
   if (!isset($tid) OR !is_numeric($rid)) {
     return FALSE;
   }
@@ -392,7 +392,7 @@ function taxonomy_access_grant_update($t
  *   A hash of the grants in the form of $grants['perm'] = boolean
  *   A value of 1 will grant the permission for this user and term.
 **/
-function taxonomy_access_defaults_update($vid, $rid = null, $grants = null) {
+function taxonomy_access_defaults_update($vid, $rid = NULL, $grants = NULL) {
   if (!isset($vid) OR !is_numeric($rid)) {
     return FALSE;
   }
@@ -438,7 +438,7 @@ function taxonomy_access_defaults_update
 **/
 function taxonomy_access_get_grants($rid) {
   if (!isset($rid)) {
-    return false;
+    return FALSE;
   }
   if (isset($rid) && !is_numeric($rid)) {
     $rid = db_result(db_query("SELECT rid FROM {role} WHERE name='%s'", $rid));
@@ -472,7 +472,7 @@ function taxonomy_access_get_grants($rid
 **/
 function taxonomy_access_get_default_grants($rid) {
   if (!is_numeric($rid)) {
-    return false;
+    return FALSE;
   }
   $result = db_query("SELECT * FROM {term_access_defaults} WHERE rid=%d", $rid);
   $grants = array();
@@ -502,9 +502,9 @@ function taxonomy_access_get_default_gra
  */
 function _taxonomy_access_get_nodes_for_term($tid) {
   $nid = array();
-  $result = db_query("SELECT nid FROM {term_node} WHERE tid = '$tid'");
+  $result = db_query("SELECT nid FROM {term_node} WHERE tid = %d", $tid);
   
-  while($node = db_fetch_object($result)) {
+  while ($node = db_fetch_object($result)) {
     $nid[] = $node->nid;
   }
   return $nid;
@@ -526,12 +526,12 @@ function _taxonomy_access_get_nodes_for_
     LEFT JOIN {term_data} d ON n.tid = d.tid
     LEFT JOIN {term_access} a ON n.tid = a.tid
     WHERE d.vid = '$vid'";
-  if(!is_null($rid)) {
+  if (!is_null($rid)) {
     $query .= " AND a.rid = '$rid'";
   }
   $result = db_query($query);
   
-  while($node = db_fetch_object($result)) {
+  while ($node = db_fetch_object($result)) {
     $nid[] = $node->nid;
   }
   return $nid;
@@ -552,7 +552,7 @@ function _taxonomy_access_get_nodes_for_
     SELECT n.nid FROM {term_node} n LEFT JOIN {term_access} a ON n.tid = a.tid WHERE a.rid = '$rid'
   ");
   
-  while($node = db_fetch_object($result)) {
+  while ($node = db_fetch_object($result)) {
     $nid[] = $node->nid;
   }
   return $nid;
@@ -565,7 +565,7 @@ function _taxonomy_access_get_nodes_for_
  *    An array of node ids for which to acquire access permissions
  */
 function _taxonomy_access_node_access_update($nid) {
-  foreach($nid as $node) {
+  foreach ($nid as $node) {
     $loaded_node = node_load($node, NULL, TRUE);
     if (!empty($loaded_node)) {
       node_access_acquire_grants($loaded_node);
