I just did the update and I got these errors almost immediately.
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT n.title, n.status, b.mlid FROM node n, book b INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 11 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 8 AND na.realm = 'content_access_rid') OR (na.gid = 11 AND na.realm = 'nodeaccess_userreference'))) AND (((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND gid=0 AND realm='all') > 0) OR ((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND realm IN ('content_access_author','content_access_rid')) = 0 OR (SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND ((gid=11 AND realm='content_access_author') OR (gid=2 AND realm='content_access_rid') OR (gid=8 AND realm='content_access_rid'))) > 0) AND ((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND realm IN ('nodeaccess_userreference')) = 0 OR (SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND ((gid=11 AND realm='nodeaccess_userreference'))) > 0)) AND ( n.nid = 68 AND b.nid = n.nid) in /var/www/html/ppl/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 487.
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT mlid, weight, link_title FROM menu_links INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 11 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 8 AND na.realm = 'content_access_rid') OR (na.gid = 11 AND na.realm = 'nodeaccess_userreference'))) AND (((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND gid=0 AND realm='all') > 0) OR ((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND realm IN ('content_access_author','content_access_rid')) = 0 OR (SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND ((gid=11 AND realm='content_access_author') OR (gid=2 AND realm='content_access_rid') OR (gid=8 AND realm='content_access_rid'))) > 0) AND ((SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND realm IN ('nodeaccess_userreference')) = 0 OR (SELECT COUNT(1) FROM node_access nasq WHERE na.nid=nasq.nid AND ((gid=11 AND realm='nodeaccess_userreference'))) > 0)) AND ( plid = 0 )ORDER by weight, link_title in /var/www/html/ppl/sites/all/modules/advancedbookblocks/advancedbookblocks.module on line 469.
Comments
Comment #1
jzornig commentedI believe it is caused by incorrect usage of db_rewrite_sql() where the primary table being queried is not {node}.
Comment #2
jdvc commentedI've got the same issue. Attached copy of error.
Comment #3
fugazi commentedI've got the same issue.
Comment #4
jvieille commentedSame
ABB is broken
Comment #5
jdvc commentedI rolled the module back to advancedbookblocks-6.x-2.1 and it seemed to fix the issue, just fyi.
Comment #6
jjancel commentedI've got the same issue.
administrators = ok
Visitors = error Unknown column 'n.nid'
Comment #7
ransomweaver commentedI also have this problem with 2.2. ok for admin, not for anon.
Comment #8
lucacerone commentedGot the same problem..
Rolling back to the old version, I hope this is fixed soon..
Comment #9
jvieille commentedeither this bug is solved or the current release shall be deprecated
Comment #10
Frodo Looijaard commentedThe problem seems to be that a lot of db_rewrite_sql statements were added in 2.2 (which is a good thing), but they are not handled in the right way.
If a db_rewrite_sql statement is not working on the {node} table with alias n you have to specify which table and which primary key it is working on. That was everywhere omitted. Also, you should not use multiple table names in a FROM clause, but instead use INNER JOIN clauses.
The attached patch hopefully solves all these problems. Note that it has not been extensively tested and I have not reviewed whether this is functionally correct. But it should at least work and provide some safety.
Comment #11
Frodo Looijaard commentedWith the attached patch, the i18n module suddenly starts working too. Like with normal books, nodes which are in the wrong language are not displayed in the tree anymore.
Comment #12
parasolx commentedafter applied these patches, my problem solves. everything goes correctly as it does.
bravo for the patches
Comment #13
mpotter commentedI also had this same error when using Anonymous user (worked fine for User-1). Tried patch in #10 but it made the Advanced Book module so slow that it killed my MySQL server. Sat at 100% CPU for over 10 minutes. Finally killed the process, restarted MySQL, then reverted to Advanced Book Module v2.1 and is now working again. So I can't tell if the patch fixes the problem or not. But ABM 2.2 is unusable at this point, so this should be marked as a critical issue.
Comment #14
parasolx commentedhave you done patch #11. patch #10 only half. you need to do both file of patching.
Comment #15
ransomweaver commentedConfirming rewrites-2 then rewrites-inc is a fix. Well done!
Comment #16
mike.y commentedApplying both patches seems to have fixed this issue for me. Thanks!
Comment #17
tchurch commentedPatch #11 worked for me too. I only needed to use the patch file advancedbookblocks-2.2-fix-rewrites-2.diff
Comment #18
PixelClever commentedCommitted in 2.3. I tested on my install, but if someone has a problem post it here. Thank you for posting the patch.
Comment #19
jzornig commented2.3 is working on my site. But I now get a new issue see http://drupal.org/node/982076