Closed (fixed)
Project:
Advanced Book Blocks
Version:
6.x-1.9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 Sep 2009 at 15:05 UTC
Updated:
30 Dec 2009 at 18:50 UTC
Jump to comment: Most recent file
You can create new book, but it will not be automatically enabled for specific block even if it has specific taxonomy term associated with it. You can go into ABB block setting and do Mass Enable and the book will be enabled for that block. It is only taxonomy automation that does not work. (I use Drupall 6.14)
I suspect that the problem lies in this part of code -
$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);
}
}
}
Someone with deeper Drupal understanding might figure out what is the problem here.
I think we should use something along the lines with
$result = db_query("SELECT tid FROM {term_node} WHERE nid = %d", $bid);
while ($term = db_fetch_object($result)) {
$node_terms[] = $term->tid;
if (array_intersect($node_terms,$tid_trig_array) != NULL) {
$check[] = array_intersect($node_terms,$tid_trig_array);
}
}
as it does in Mass Enable feature in ABB module.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | advancedbookblocks.patch | 2.86 KB | Azol |
| #1 | advancedbookblocks.module in zip archive | 4.79 KB | Azol |
Comments
Comment #1
Azol commentedI am not yet familiar with patching system, so I just went through all the code and I changed many things that were causing bugs with:
1) New books never appearing in AB blocks with Taxonomy Automation options set;
2) Books re-appearing in different AB blocks after editing or deleting top-level books;
I attached the whole advancedbookblocks.module file here. Please test it in your ABB 6.x-1.9 installations (just replace original file) and let me know if it solves your problems the way it solved mine.
Comment #2
Azol commentedOkay, here is the corresponding patch, use it for 1.9 version of ABB and let me know if it fix the issues for you.
Comment #3
PixelClever commentedThis patch has been commited in 6.x-2.0-alpha1