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

nickbits’s picture

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

aron novak’s picture

Status: Active » Needs review
StatusFileSize
new1.15 KB

Thanks for the bugreport, yeah, this issue is rather serious.
Can you test the attached patch?

nickbits’s picture

Hi,

Thanks for that. Will test it as soon as I get a chance, with any luck Friday or Sat.

Nick

aron novak’s picture

Status: Needs review » Fixed

Committed.

imclean’s picture

This problem still exists in 6.x-1.9-beta3.

aquanox24’s picture

subscribe.
Patch File doesn't work

imclean’s picture

It's a one line patch, it's pretty easy to change it yourself. Have a look at the patch file.

markfoodyburton’s picture

Status: Fixed » Needs work

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

markfoodyburton’s picture

MMm, that doesn't seem to change anything :-(

Not sure whats going on :-(

markfoodyburton’s picture

Status: Needs work » Patch (to be ported)

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.

aron novak’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
StatusFileSize
new1.17 KB

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 ]

bcobin’s picture

Neither patch worked for me, but I manually replaced the offending line and the problem seems to be solved!

Thanks much...

stevensabatier’s picture

Hey, i just wanted to thank you Mark, i patched it and works great! Couldn't do this without ppl like you!

markfoodyburton’s picture

:-)

Anonymous’s picture

It worked like a charm.

aron novak’s picture

Status: Reviewed & tested by the community » Fixed

markfoodyburton: thanks, the feedbacks seem to be good, i just committed your patch.

kostajh’s picture

I updated FeedAPI to the 1.x-dev version and can confirm that this fixes the problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.