Project:Advanced Book Blocks
Version:6.x-1.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

I recently deleted some book nodes (through the drupal ui) and noticed that the records are not removed from table adv_book_custom. I think this could be done easily in a _nodeapi() where $op == delete. I found this issue while debugging another problem so I listed it as a bug but it could be a feature request. In any case, a cleaner adv_book_custom table will result in less loops through recursive_book_array_builder($nid_array) so the code will be more efficient.

Comments

#1

I think my patch solves this problem as well (1st comment in #585716: New book never becomes enabled automatically if any ABB use taxonomy terms as condition issue thread)
The problem is with module code starting at line 544 where we get the book ID. The problem is if you DELETE a top-level book (line 614), the book ID ($bid) is still undefined, so the book never becomes actually deleted and you end up with corruption in adv_book_custom table instead. My solution was to swap lines 543 and 544 so $bid is getting correct value BEFORE the 'if' statement.

Replace your module with the file attached and check if the problem goes away. It will not heal already corrupted table though. Better uninstall/delete the module completely (so it cleans up all the custom tables), reinstall and replace the file.

I was trying to contact ABB author (Aaron Hawkins) about preparing the next version with several bugfixes, but to no avail. I use this module extensively and have not discovered any flaws with the solution yet. Let me know if it solves your issue.

#2

#3

Status:active» needs review
nobody click here