Hi All,
I have just upgraded my feedapi to the latest Dev one and now get the following error:
user warning: Unknown column 'Array.nid' in 'on clause' query: SELECT n.title, n.nid FROM node n INNER JOIN node_access na ON na.nid = Array.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public'))) AND ( n.nid IN (0) )ORDER BY title DESC in /home/thatcham/public_html/sites/all/modules/feedapi/feedapi_node/feedapi_node.module on line 98.
I am using the latest OG module, version 2. Not sure what is causing it, have cleared the cache, etc. but still there.
Nick
Comments
Comment #1
nickbits commentedHi,
Just down graded to feedapi 6.x-1.8 and it works fine. so it would appear to be an issue with the latest dev release.
Nick
Comment #2
aron novakThanks for the bugreport, yeah, this issue is rather serious.
Can you test the attached patch?
Comment #3
nickbits commentedHi,
Thanks for that. Will test it as soon as I get a chance, with any luck Friday or Sat.
Nick
Comment #4
aron novakCommitted.
Comment #5
imclean commentedThis problem still exists in 6.x-1.9-beta3.
Comment #6
aquanox24 commentedsubscribe.
Patch File doesn't work
Comment #7
imclean commentedIt's a one line patch, it's pretty easy to change it yourself. Have a look at the patch file.
Comment #8
markfoodyburton commentedThere is still a problem
With the patch (or the latest Beta), I get:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(n.nid) FROM node n INNER JOIN node_access na ON na.nid = n.nid WHERE (' at line 1 query: SELECT n.title, DISTINCT(n.nid) FROM node n 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 = 25 AND na.realm = 'og_subscriber'))) AND ( n.nid IN (29) )ORDER BY title DESC
I suspect this is dependent upon: #284392: db_rewrite_sql causing issues with DISTINCT
Cheers
Mark
Comment #9
markfoodyburton commentedMMm, that doesn't seem to change anything :-(
Not sure whats going on :-(
Comment #10
markfoodyburton commentedSolved:
Index: feedapi_node/feedapi_node.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feedapi/feedapi_node/Attic/feedapi_node.module,v
retrieving revision 1.1.2.18.2.47
diff -r1.1.2.18.2.47 feedapi_node.module
98c98
< $result = db_query(db_rewrite_sql("SELECT n.title, n.nid FROM {node} n WHERE n.nid IN (". db_placeholders($node->feedapi_node->feed_nids, 'int') .") ORDER BY title DESC"), $node->feedapi_node->feed_nids);
---
> $result = db_query(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.nid IN (". db_placeholders($node->feedapi_node->feed_nids, 'int') .") ORDER BY title DESC"), $node->feedapi_node->feed_nids);
you need the nid as the first element, so that it gets the 'distinct' clause round it.
Hope this helps
Cheers
Mark.
Comment #11
aron novakThis patch is fine, thank you Mark!
I attached this as a file. Can you confirm someone else that this helps?
I cannot understand at the moment how the order of the columns matter, but this does not matter here :) if it helps.
[ otherwise, it's a totally different problem as the initial post, the patch in #2 is really important also ]
Comment #12
bcobin commentedNeither patch worked for me, but I manually replaced the offending line and the problem seems to be solved!
Thanks much...
Comment #13
stevensabatier commentedHey, i just wanted to thank you Mark, i patched it and works great! Couldn't do this without ppl like you!
Comment #14
markfoodyburton commented:-)
Comment #15
Anonymous (not verified) commentedIt worked like a charm.
Comment #16
aron novakmarkfoodyburton: thanks, the feedbacks seem to be good, i just committed your patch.
Comment #17
kostajh commentedI updated FeedAPI to the 1.x-dev version and can confirm that this fixes the problem.