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)

CommentFileSizeAuthor
#2 uc_reports.pgsql_.patch1.77 KBcha0s

Comments

webchick’s picture

Somewhat 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.

cha0s’s picture

Version: 6.x-2.0-beta2 » 6.x-2.x-dev
Assigned: Unassigned » cha0s
Status: Active » Needs review
StatusFileSize
new1.77 KB

Nice find. I decided to fix all the reports pgsql bugs I could find, so you get a twofer :)

Island Usurper’s picture

Status: Needs review » Fixed

Great. Committed.

Status: Fixed » Closed (fixed)

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