user warning
nickbits - October 16, 2009 - 09:47
| Project: | FeedAPI |
| Version: | 6.x-1.x-dev |
| Component: | Code (general) |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
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

#1
Hi,
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
#2
Thanks for the bugreport, yeah, this issue is rather serious.
Can you test the attached patch?
#3
Hi,
Thanks for that. Will test it as soon as I get a chance, with any luck Friday or Sat.
Nick
#4
Committed.
#5
This problem still exists in 6.x-1.9-beta3.
#6
subscribe.
Patch File doesn't work
#7
It's a one line patch, it's pretty easy to change it yourself. Have a look at the patch file.
#8
There 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
#9
MMm, that doesn't seem to change anything :-(
Not sure whats going on :-(
#10
Solved:
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.
#11
This 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 ]
#12
Neither patch worked for me, but I manually replaced the offending line and the problem seems to be solved!
Thanks much...
#13
Hey, i just wanted to thank you Mark, i patched it and works great! Couldn't do this without ppl like you!
#14
:-)
#15
It worked like a charm.