Announcements & Anonymous users == mysql twist

allrobb - June 19, 2008 - 05:06
Project:Announcements
Version:5.x-1.0
Component:Code
Category:support request
Priority:critical
Assigned:NancyDru
Status:closed
Description

Hello all, realy like this project, but i just ran into something i cant explain.
ive already tried to uninstall some other modules and try to change the permissions, but i cant get it fixed

i want to be able to let my anonymous users view my announcements.

i have a menuitem with a link to host/announcements (also tried /accouncements/view), but when i go there with a browser thats not logged in i get this :

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 'nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( n.t' at line 1 query: SELECT COUNT(*) FROM node n INNER JOIN announcements a ON n.nid = a.nid INNER JOIN node_access na ON na.nid = 1213851208.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( n.type='announcements' AND a.expiration_date > 0 ) in /httpdocs/includes/database.mysql.inc on line 172.
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 'nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( n.t' at line 1 query: SELECT n.nid FROM node n INNER JOIN announcements a ON n.nid = a.nid INNER JOIN node_access na ON na.nid = 1213851208.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( n.type='announcements' AND a.expiration_date > 0 ) ORDER BY n.sticky DESC, a.publish_date DESC LIMIT 0, 10 in /httpdocs/includes/database.mysql.inc on line 172.

the best thing is, when u give the anonymous user edit perms, he can access it perfectly (and edit it..)
but when u take away that perm, again, the same errors.

ive tried to reinstall it, still the same problem.

running on php5 / apache / mysql5

i didnt install devel yet, but i will, and ill keep investigating this issue.
if u need more details(like a list of mods installed/log files) / other info, -OR- did i just overlooked that critical thing to get it working, contact me or just reply please.

Thanks, Rob

#1

NancyDru - June 19, 2008 - 13:00
Status:active» postponed (maintainer needs more info)

Hmm, it works fine for me, but I don't have any access control modules like you obviously have. It looks to me like your access control module is incorrectly altering the SELECT statement where is joins the node table to the node_access table. I would suggest at least cross-posting this issue against that module.

#2

allrobb - June 19, 2008 - 15:00

thanks for the quick reply

before i cross post it (im still a bit new n all) i am going to set up a clean test environment and ONLY install this module & set up my access control perms.
i dont have any other mod installed for access control.. and i run a very basic system.

ill keep u posted on my progress, maybe ill (cross)post more info tonight if i have some time left.

#3

NancyDru - June 19, 2008 - 15:59

Some other module is grabbing our query and modifying it (hook_db_rewrite_sql) and it looks like a normal access control module change.

#4

NancyDru - June 19, 2008 - 17:21
Status:postponed (maintainer needs more info)» fixed

My apologies. Apparently my lack of sleep was preventing me from seeing what all these symptoms meant. You are right; there was a malformed pager_query when teh user did not have "edit" permission.

Fix committed to both branches (-dev release).

#5

allrobb - June 19, 2008 - 20:16

nice to hear u found it, im going to test it right away after i get some sleep :)

#6

Anonymous (not verified) - July 3, 2008 - 20:23
Status:fixed» closed

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

#7

joris.verschueren - August 1, 2008 - 18:40

Tragically, this would have to be re-opened. Tragically, because it's a very nice module and I would love to keep it. unfortunately my anonymous user doesn't get to see announcements either, but this time it's due to organic groups as you can read in the following. (I've reinstalled and everything, that wasn't the rub).

    * 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 'nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid ' at line 1 query: SELECT COUNT(*) FROM node n INNER JOIN announcements a ON n.nid = a.nid INNER JOIN node_access na ON na.nid = 1217614730.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.type='announcements' AND a.expiration_date > 0 ) in C:\xampp\htdocs\fzovllocal\includes\database.mysql.inc on line 172.
    * 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 'nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid ' at line 1 query: SELECT n.nid FROM node n INNER JOIN announcements a ON n.nid = a.nid INNER JOIN node_access na ON na.nid = 1217614730.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.type='announcements' AND a.expiration_date > 0 ) ORDER BY n.sticky DESC, a.publish_date DESC LIMIT 0, 10 in C:\xampp\htdocs\fzovllocal\includes\database.mysql.inc on line 172.

I thought it might be related to this http://drupal.org/node/82146 desperate cry.
any clue? I would need OG enabled, part of my site's nodes need to be kept private.

thanks in advance,

Joris

#8

NancyDru - August 23, 2008 - 17:40
Assigned to:Anonymous» NancyDru
Status:closed» postponed (maintainer needs more info)

If you update a closed issue, you need to re-open it or the maintainer may never see it. I just found this by going way back in my "recent posts".

Have you tried the -dev version, which is where the fix mentioned above would be.

#9

NancyDru - August 25, 2008 - 13:18

I just rolled a new release that has all the previous fixes in it.

#10

NancyDru - August 26, 2008 - 17:40
Status:postponed (maintainer needs more info)» fixed

If this is still happening, I don't think it's a Announcements issue.

#11

Anonymous (not verified) - September 9, 2008 - 17:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.