There is an error on the user view page when the event module is installed.
I'm assuming this is PostgreSQL specific as it looks like an SQL compliance issue MySQL probably overlooks.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /httpdocs/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT DISTINCT (n.nid), n.title FROM node n INNER JOIN signup_log s_l ON n.nid = s_l.nid LEFT JOIN event e ON e.nid = n.nid 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'))) AND ( s_l.uid = '3' AND (e.event_start >= 1178656468 OR e.event_start IS NULL) ) ORDER BY n.nid, e.event_start in /httpdocs/includes/database.pgsql.inc on line 144
I have included a patch to solve the problem, against 5.x-2.0
| Comment | File | Size | Author |
|---|---|---|---|
| fix_2.patch | 1010 bytes | Anonymous (not verified) |
Comments
Comment #1
dwwthanks for the report and the patch. FYI: the usual workflow is to post patches as "code needs review". only once someone other than the patch author has reviewed it and tested it do they set it to "ready to be committed" (RTBC).
anyway, your description sounds reasonable, and the patch looks good to me. someone just needs to test on both mysql and pgsql, then i'll commit this. i might be able to do that testing myself relatively soon, but i'm in the middle of a bunch of other work right now. anyway, thanks again, and i'll make sure to get this in before the next official release.
cheers,
-derek
Comment #2
dwwhrm, couldn't reproduce the error on a test site with pgsql 8.1.4 with php 4.4.5.
i made some signup-enabled events, signed up for them, and visited both /user/1 and /user/1/signups. i saw no errors on either page.
can you please provide more details on your environment and exactly what you did to produce this bug?
thanks,
-derek
p.s. that said, i tried testing things on both pgsql and mysql with your patch applied, and all appears to still work, so i might just commit it anyway, but i'd like to know exactly what's causing the problem in the first place.
Comment #3
Anonymous (not verified) commentedAfter looking at it a bit more, it seems this bug exhibits itself only when an access control module that adds a DISTINCT to the select list during db_rewrite_sql is used (such as Organic Groups)
Comment #4
dwwahh, cool. in that case, this is back to "needs review". thanks.
Comment #5
Anonymous (not verified) commentedI went ahead and verified that the patch works properly both with and without Organic Groups on postgres 7.4, 8.0 and 8.2.4, and Mysql 4.1 and 5.0, and without the patch, the problem shows up with Organic Groups on all versions of postgres.
Comment #6
Anonymous (not verified) commentedThis may be related to http://drupal.org/node/128846
I will try the various patches floating around for the problem in core and see if one of them fixes the issue without patching Signup
Comment #7
dwwCommitted to HEAD, DRUPAL-5 and DRUPAL-4-7. Thanks (and sorry for the delay!). ;)
Comment #8
(not verified) commentedComment #9
socialnicheguru commentedsubscribing