Hi,

I get the following error when I look at the Signup administration page.

    warning: pg_query() [function.pg-query]: Query failed: ERROR: column "n.type" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/html/includes/database.pgsql.inc on line 139.

    user warning: query: SELECT n.nid, n.title, n.type, s.status AS signup_status, COUNT(s_l.nid) AS signup_total, s.close_signup_limit AS signup_close_signup_limit FROM node n INNER JOIN signup s ON s.nid = n.nid LEFT JOIN signup_log s_l ON s.nid = s_l.nid GROUP BY n.nid, n.title, signup_status, signup_close_signup_limit ORDER BY n.title ASC LIMIT 25 OFFSET 0 in /var/www/html/modules/signup/includes/admin.signup_administration.inc on line 76.

Also, when I create new content, I don't see an option to make the content "Signup enabled". I'm no Drupal expert so I'm assuming it has something to do with the above error.

Thanks

Comments

-Mania-’s picture

Same error, using PostgreSQL 8.1.19.

maikeru’s picture

Status: Active » Needs review
StatusFileSize
new362 bytes

Caused by n.type not being include in the group by clause.

More information : http://drupal.org/node/555530

Heres a patch against 6.x-1.0-rc6.

maikeru’s picture

StatusFileSize
new950 bytes

Another error when creating a CCK date field and linking to the sign-up content type.

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "`" at character 287 in /var/vhost/drupal/drupal-6.17/includes/database.pgsql.inc on line 139.
    * user warning: query: SELECT n.nid, n.title, n.type, s.status AS signup_status, COUNT(s_l.nid) AS signup_total, s.close_signup_limit AS signup_close_signup_limit, event.field_date_value FROM node n INNER JOIN signup s ON s.nid = n.nid LEFT JOIN signup_log s_l ON s.nid = s_l.nid LEFT JOIN content_type_event `event` ON event.vid = n.vid GROUP BY n.nid, n.title, signup_status, signup_close_signup_limit ORDER BY n.title ASC LIMIT 25 OFFSET 0 in /home/staff/michaela/vhost/www.test.com.au/modules/signup/includes/admin.signup_administration.inc on line 76.

Not sure if replacing backticks with quotes is correct. There was also an error relating to the date field not being included in a different group_by clause.

Attached a new patch.

ezra-g’s picture

Title: Signup Administration Page Error » Signup Administration Page Error with Postgres
Issue tags: +PostgreSQL
ezra-g’s picture

Status: Needs review » Fixed

Works fine on MySQL 5.1.44. Committed, thanks!

This administration page seems like it should be replaced by Views + VBO integration as a followup to #582986: Make views a required dependency and ditch non-views code.

ezra-g’s picture

Version: 6.x-1.0-rc6 » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)
greggles’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Needs review
StatusFileSize
new1.44 KB

Not sure if replacing backticks with quotes is correct.

It might be correct for postgresql, but not mysql. 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 '"training" ON training.vid = n.vid GROUP BY n.nid, n.title, n.type, signup_statu' at line 1 query: SELECT n.nid, n.title, n.type, s.status AS signup_status, COUNT(s_l.nid) AS signup_total, s.close_signup_limit AS signup_close_signup_limit, training.field_class_date_value FROM node n INNER JOIN signup s ON s.nid = n.nid LEFT JOIN signup_log s_l ON s.nid = s_l.nid LEFT JOIN content_type_training "training" ON training.vid = n.vid GROUP BY n.nid, n.title, n.type, signup_status, signup_close_signup_limit, training.field_class_date_value ORDER BY n.title ASC LIMIT 0, 25 in _db_query() (line 141 of /home/greggles/workspace/d6/includes/database.mysqli.inc).

Attached patch switches to no table escaping and instead using a prefix on the alias name so we are sure it's never a reserved word.

ezra-g’s picture

Status: Needs review » Fixed
dww’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)

Thanks for fixing this! Back to the 6.x-2.x branch for joachim...

dww’s picture

Issue tags: -database

Uhh, and wtf with these tags? ;) the pgsql one makes sense, but the others? Ugh. We really need #917880: Write a handbook page about how issue tags are intended to be used ...