Postgres seems to need every column in the group by, not only the PK.

This commit is contained in:
Thomas Keller 2012-04-18 23:00:37 +02:00
parent d1542c9c00
commit 84d80af1ce

View File

@ -76,13 +76,14 @@ class IDF_Tag extends Pluf_Model
); );
$table = $this->_con->pfx.'idf_project_idf_tag_assoc'; $table = $this->_con->pfx.'idf_project_idf_tag_assoc';
$cols = implode(', ', array_keys($this->_a['cols']));
$this->_a['views'] = array( $this->_a['views'] = array(
'join_projects' => 'join_projects' =>
array( array(
'join' => 'LEFT JOIN '.$table 'join' => 'LEFT JOIN '.$table
.' ON idf_tag_id=id', .' ON idf_tag_id=id',
'select' => $this->getSelect().',COUNT(idf_project_id) as project_count', 'select' => $this->getSelect().',COUNT(idf_project_id) as project_count',
'group' => 'id', 'group' => $cols,
'props' => array('project_count' => 'project_count'), 'props' => array('project_count' => 'project_count'),
), ),
); );