Download & Extend

Using Photo Album with Postgres gives errors in pq_query()

Project:Photo album
Version:4.6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Klicking the the Link "albums" raises the following warnings/errors:

warning: pg_query(): Query failed: ERROR: column "f.id" must appear in the GROUP BY clause or be used in an aggregate function in /var/www/content/includes/database.pgsql.inc on line 45.

and

user error:
query: SELECT f.name as fname, realm, u.name, u.uid, COUNT(f.name) AS fcount FROM folksonomy f INNER JOIN node n ON f.id = n.nid INNER JOIN users u ON n.uid = u.uid WHERE realm LIKE 'album_%' GROUP BY f.name, realm, u.name, u.uid ORDER BY id DESC LIMIT 50 OFFSET 0 in /var/www/content/includes/database.pgsql.inc on line 62.

I use drupal 4.6.2 with folksonomy, version ? (no version information) and image from September 29, 2004.
PHP is 4.3.10-5-Debian Sarge and Postgres 7.4.1 - Debian Sarge

Torsten

Comments

#1

This patch fixes problem. It's been tested with PostgreSQL only.

It also fixes problems with wrong grouping of elements (it was bad to order by f.id)

AttachmentSize
album.patch 2.2 KB