when i browse the XML feed of Buddies posts (usually http://www.domain.net/buddylist/1/buddies/recent/feed) and the error comes up

user warning: Unknown column 'n.nid' in 'field list' query: SELECT DISTINCT(n.nid) FROM node 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 = 393 AND na.realm = 'og_subscriber') OR (na.gid = 202 AND na.realm = 'og_subscriber') OR (na.gid = 288 AND na.realm = 'og_subscriber'))) AND ( status = 1 AND uid IN (6,9,10,98,101,102,140,171,184,215,315,418) ) ORDER BY nid DESC in /home/domains/public_html/includes/database.mysql.inc on line 172.
CommentFileSizeAuthor
#3 buddylist-db_rewrite_sql.patch1.02 KBJohn Morahan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dldege’s picture

Based on the query it looks like it might be related to node access rules being imposed by Organic Groups. You'll need to narrow it down a bit as the link seems to work fine without organic groups in my quick testing.

coldfly’s picture

yes
I tested it and found it will happen when og module is on

John Morahan’s picture

Version: 5.x-1.0 » 5.x-1.x-dev
Status: Active » Needs review
FileSize
1.02 KB

There's no 'n' alias for db_rewrite_sql to use. This would affect any node access module, not just OG.

Patch attached.

coldfly’s picture

thank you very much
this patch works
and the feed page gives the right content now

funana’s picture

Hmmm. I patched the file but the buddy feed still doesnt show up (blank page, endless loading).

Any help appreciated!

John Morahan’s picture

funana, do you get any error message? (on the screen, on the next page, in your watchdog or apache logs)?
also, are you using any node access modules?

funana’s picture

No errors on screen, next page or drupal logs (the xml page is loading endless, page does not return, stays blank). I don't have access to apache logs, sorry.
I have no node access modules installed.

funana’s picture

Update: I found out that it works, if a user just has one or two friends.

So maybe this is caused because of heavy loads?

Arent you just extracting the 25 last entries of buddies? Or are you extracting the last 25 entries of every buddy? That would be bad anyways.

Leeteq’s picture

Subscribing.