$result = db_query("SELECT vid FROM {vocabulary} WHERE name <> 'FORUMS'");
          while ($vocab = db_fetch_object($result)) {
            if (is_array($node->taxonomy[$vocab->vid])) {
              if (array_intersect($node->taxonomy[$vocab->vid], $tid_trig_array) != NULL) {
                $check[] = array_intersect($node->taxonomy[$vocab->vid], $tid_trig_array);
              }
            }
           
          }

Here is a short snippet from Advanced Book module and I believe it's the sole reason the taxonomy automation does not work as expected. I believe that the author semi-abandoned it, so I would like to try and fix it myself, because I really need the automation feature this module provides.

I think that porting it straight from Drupal 5 has broken something, but I am just starting my Drupal explorations and I cannot tell for sure why this part of code looks suspicious.
What it does (well, means to) - it gets terms from vocabularies then compares the terms assigned to current node (book) to decide if this book should be enabled for this particular block or not.
The main trouble is - the code after 1st "if" statement is never executed!

Comments

briansea’s picture

if that is indeed the main trouble, try using

while ($vocab = db_result($result)) {

since you are fetching one value