OK. This Error has probably been reported but I could not find it. Anyway I have a problem. When the carousel runs as admin, the error message before does not appear. As an ordinary user, the error message appears below. I disabled gmaps, and the error was there. I'm a bit lost. Any solutions?
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT count(node.nid) FROM node node LEFT JOIN gmap_latlon gmap_latlon_field_location_0 ON node.vid = gmap_latlon_field_location_0.vid AND gmap_latlon_field_location_0.field_name = 'field_location_0' INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( (node.type IN ('event')) ) in /***/***/htdocs/includes/database.mysql.inc on line 172.
Thanks.
Kahenya
Comments
Comment #1
dave reidLooks like it should be node.nid. The node table isn't given the 'n' table alias.
Comment #2
dave reidComment #3
summit commentedHi,
I do not think is should be node.nid.
I think this is causing by a mistake of the query as: http://drupal.org/node/51696
It happens when you have access module inserting in the module query is my investigation.
I myself have still also errors like this after going for domain access.
So you have to find the query and rewrite it as described in attached link, I think.
greetings,
Martijn
Comment #4
kevin hankens commentedActually, I would agree with Dave Reid.
This code:
SELECT count(node.nid) FROM node node...Queries the table "node" and gives it an alias of "node". But,
INNER JOIN node_access na ON na.nid = n.nidis trying to do a join on table (or alias) "n", which hasn't been defined.Try changing the JOIN statement to
INNER JOIN node_access na ON na.nid = node.nidGood luck!
Comment #5
jcfiala commentedI don't have any references to gmap code in nodecarousel, so this is most likely a SQL query that you or some other part of the code is constructing, not the nodecarousel. I suggest doing a search for this query and correctin git.
Comment #6
summit commentedproblem is, as I tried to describe that probably the
is from the access usage, I do not think altering this is the way to go.
greetings,
Martijn
Comment #7
dave reidThe only module I can find with the gmap_latlon table is (duh) the GMap Lat/Lon module. Moving this issue to that module's issue queue.
Comment #8
Anonymous (not verified) commentedReturning to Nodecarousel
Hi,
Sorry away 2 days for Off line Forum
Even with all the other modules disabled. I still get the error below
I have even removed the modules, run nodecarousel on a sterile Drupal with the bare minimums and get the same error. I have tried a lot of the above options, none work.
Any other ideas?
Thanks,
Kahenya
Comment #9
summit commentedHi,
Just quick, I do not have a lot of time.
Are you aware that the
Is added to you query through your access rules. With db_rewrite_sql statement you add this to your query.
there are lots of problems with this access rule additing and already available queries in all sorts of modules.
The best solution I saw, is that you first and for all make the n.nid field the first in the SELECT query.
Please search drupal.org on db_rewrite_sql and node access and you will find lots of forum posts about this subject.
Sometimes just not using db_rewrite_sql helps, but be aware that the query is not following access rules anymore if you need those!
greetings,
Martijn
Comment #10
Anonymous (not verified) commentedWell
Quickie update. If you have Views 5.16, and nodecarousel dev or stable, this issue comes up. If I try run nodecarousel with any other option the error disappears. However, with views it appears.
Where to to look next and what to look for?
Kahenya
Comment #11
Anonymous (not verified) commentedResolved
Comment #12
kenorb commentedDuplicate of #331651: db_rewrite_sql improperly rewriting a subquery