Closed (fixed)
Project:
Hierarchical Select
Version:
5.x-3.x-dev
Component:
Coke - Book
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2008 at 17:41 UTC
Updated:
24 Aug 2008 at 14:35 UTC
I get this error/warning when trying to add a book page to a parent book page:
user warning: Column 'nid' in field list is ambiguous query: SELECT COUNT(nid) FROM book LEFT JOIN i18n_node i18n ON n.nid = i18n.nid WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) AND ( nid = 1040) in /home/dixingto/public_html/cpj/includes/database.mysqli.inc on line 154.
What happens next is the page is added - not as a child page though, but as another parent page.
Comments
Comment #1
mkrakowiak commentedAfter I disabled Hierarchical Select Book, everything seems to be OK. So, it looks like there's a bug in the HS.
Comment #2
mkrakowiak commentedComment #3
Vuds commentedI've got that too (and another, that appears it is not related so I'll create a new issue), but in my case the weird combination is with OG Access Control module.
user warning: Column 'nid' in field list is ambiguous query: SELECT COUNT(nid) FROM book 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 = 0 AND na.realm = 'og_public') OR (na.gid = 47 AND na.realm = 'og_admin'))) AND ( nid = 164) in /var/www/html/includes/database.mysql.inc on line 172.I am not able even to select a parent after receive the warning above (it appears when carrying the page in edit mode).
Disabling one or another, makes it functional again.
Comment #4
wim leersCan't be HS. HS doesn't affect any queries. If there'd be a bug, you'd notice while/after submitting a form.
Comment #5
Vuds commentedBut look Wim, I have the same problem and the module that is incompatible is *different* from mkrakowiak (me = OG Access Control, him = il8n).
Anyway, HS works on node load too. Considering that HS Book is related with nodes (= nid) and not taxonomy, and our errors are coming from a nid query, there is a real possibility to have this issue really.
Comment #6
wim leersNo.
HS doesn't alter any queries. The end.
Move to wherever applicable but I'm certain this is not an HS issue.
Comment #7
Vuds commentedYes, this is your problem:
hs_book.module
line 115
You use:
$count = db_result(db_query(db_rewrite_sql("SELECT COUNT(nid) FROM {book} WHERE nid = %d"), $item));when you should use
$count = db_result(db_query(db_rewrite_sql("SELECT COUNT(n.nid) FROM {book} n WHERE n.nid = %d"), $item));since you had been smart enough to think in preventing issues with access controls modules, but forgot that it necessary would need to do table joins in the query to do that.
Now it works perfectly.
Thanks for attention.
Comment #8
mkrakowiak commentedVuds thanks for the fix, Wim thanks for this great module.
Comment #9
wim leersHah! Right. My point still stands: HS doesn't alter any queries. I just forgot that I wrote my own queries (heavily inspired by core's of course) for hs_menu and hs_book.
Will be fixed tomorrow, now it's 2 AM and an entire day of beach volleybal, so I'm exhausted!
Comment #10
wim leersComment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.