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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ben Coleman’s picture

Status: Active » Needs review
FileSize
0 bytes

The attached patch fixes the above problem.

Ben Coleman’s picture

Sorry, the last patch was generated incorrectly. This is the correct patch.