On the sales reports page, you get an error message:
warning: pg_query() [function.pg-query]: Query failed: ERROR: column "s.order_status_id" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/drupal-6.8/includes/database.pgsql.inc on line 139.
user warning: query: SELECT s.order_status_id, s.title, s.weight, COUNT(o.order_status) as order_count FROM uc_orders as o LEFT JOIN uc_order_statuses as s ON s.order_status_id = o.order_status GROUP BY order_status, s.title, s.weight ORDER BY s.weight DESC in /var/www/drupal-6.8/sites/all/modules/ubercart/uc_reports/uc_reports.admin.inc on line 350.
To fix, edit uc_reports.admin.inc, line 350 and change
$result = db_query("SELECT s.order_status_id, s.title, s.weight, COUNT(o.order_status) as order_count FROM {uc_orders} as o LEFT JOIN {uc_order_statuses} as s ON s.order_status_id = o.order_status GROUP BY order_status, s.title, s.weight ORDER BY s.weight DESC");
TO
$result = db_query("SELECT s.order_status_id, order_status, s.title, s.weight, COUNT(o.order_status) as order_count FROM {uc_orders} as o LEFT JOIN {uc_order_statuses} as s ON s.order_status_id = o.order_status GROUP BY s.order_status_id, order_status, s.title, s.weight ORDER BY s.weight DESC");
(adds order_status to the select clause, and order_status_id to the group clause)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | uc_reports.pgsql_.patch | 1.77 KB | cha0s |
Comments
Comment #1
webchickSomewhat OT, but ccurvey, drop by #drupal on irc.freenode.net sometime if you want someone to help you out in getting setup for creating "true" patches for the awesome bugs you're reporting! :)
And/or check out http://drupal.org/patch for all the nitty-gritty details.
Comment #2
cha0s commentedNice find. I decided to fix all the reports pgsql bugs I could find, so you get a twofer :)
Comment #3
Island Usurper commentedGreat. Committed.