Hi all

I've created a view to list all nid's that conform to the 2 filters, filter by content type and filter CCK field value. All the proper nid's display however when I enable grouping, I get the following error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 query: SELECT COUNT(node.nid) AS nid FROM node node INNER JOIN content_type_conference_registration node_data_field_conf_reg_reg_status ON node.vid = node_data_field_conf_reg_reg_status.vid WHERE (node_data_field_conf_reg_reg_status.field_conf_reg_reg_status_value = 'Confirmed - Normal') AND (node.type in ('conference_registration')) GROUP BY in /usr/www/users/beautyr/test.beautyforashes.co.za/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1149.

Please could you offer some advice?

Comments

GlitchFreak’s picture

I don't think it's grouping by properly since there is no criteria after 'GROUP BY'

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new704 bytes

This patch solves the issue for me

GlitchFreak’s picture

Status: Needs review » Reviewed & tested by the community

Patch works for me, thanks D. Changing status to reviewed, however more testers are welcome.

merlinofchaos’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 6.x-3.x -- does not apply to 7.x-3.x

dawehner’s picture

Status: Patch (to be ported) » Fixed

And ported.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dawehner’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new739 bytes
new697 bytes

This sadly caused another issue.

Here is a patch to fix the problem in both d6 and d7.

stella’s picture

Status: Needs review » Needs work

i'm not sure about that one... surely if $this->groupby is empty then there should be no group by clause at all? i.e. the $non_aggregates array should only be used if we are indeed adding a group by clause

At least that's my understanding... currently with that patch i get a group by clause on queries that i don't expect a group by on