Saving a node that uses community_tags produces the following error on a PostgreSQL-based Drupal 7 installation:
PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "t.vid" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT t.tid, t.vid, t.name, count(t.tid) tag_count FROM tax... ^: SELECT t.tid, t.vid, t.name, count(t.tid) tag_count FROM {taxonomy_term_data} t INNER JOIN {community_tags} c ON c.tid = t.tid WHERE c.nid = :nid GROUP BY t.tid; Array ( [:nid] => 68737 ) in _community_tags_get_node_tags() (line 1356 of /home/duoview/public_html/sites/all/modules/community_tags/community_tags.module).
When using GROUP BY, PostgreSQL requires that all selected fields be in the GROUP BY, or be the result of an aggregate function. Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | community_tags_postgresql_compability_fix-1408256-2.patch | 1.3 KB | ben coleman |
| #1 | community_tags_postgresql_compability_fix-1408256-1.patch | 0 bytes | ben coleman |
Comments
Comment #1
ben coleman commentedThe attached patch fixes the above problem.
Comment #2
ben coleman commentedSorry, the last patch was generated incorrectly. This is the correct patch.