Hi,
I installed the module on my drupal 5.3 installation, running on WIndows IIS with PostgreSQL 8.5. I can use node_style successfully, creating and applying schemes works like expected. However, while trying to list the existing schemes I'm getting the following error (which makes it hard to organize the schemes):
Referer: http://myhost.com/admin/build/node_style
Message: query: SELECT s.name, s.sid, COUNT(m.sid) AS count FROM node_style_schemes s LEFT JOIN node_style_maps m USING (sid) GROUP BY s.sid ORDER BY s.name in D:\my\path\includes\database.pgsql.inc in line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: column "s.name" must appear in the GROUP BY clause or be used in an aggregate function in D:\my\path\includes\database.pgsql.inc on line 125.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node_style.module.diff | 363 bytes | deining |
Comments
Comment #1
Zen commentedIf you are comfortable with editing some code, can you please try reordering the SELECT variable list in the query so that s.sid is listed first? I think that should do the trick. I don't have a pgSQL install to test this on, sorry.
Thanks Andreas.
-K
Comment #2
deining commentedNo, that didn't do the trick.
However, it looks like others encountered this error, too: http://drupal.org/node/92809
So I simply added s.name to the GROUP BY clause of the query:
SELECT s.name, s.sid, COUNT(m.sid) AS count FROM node_style_schemes s LEFT JOIN node_style_maps m USING (sid) GROUP BY s.sid,s.name ORDER BY s.name
I created a patch file which you find attached. With that patch applied, node_style is running smoothly on PostgreSQL now.
Comment #3
Zen commentedFixed in 6-dev. Thanks for the patch.
Comment #4
Zen commented