today I created a view with a grouped exposed filter on a list field. I have two exposed filter values which group two values of the field. This view produces the following invalide SQL:

SELECT node.created AS node_created, node.nid AS nid
{node} node
INNER JOIN {field_data_field_list_field} field_data_field_list_field ON node.nid = field_data_field_list_field.entity_id AND (field_data_field_list_field.entity_type = 'node' AND field_data_field_list_field.deleted = '0')
WHERE (( (node.status = '1') AND (node.type IN  ('car')) AND (field_data_field_list_field.field_list_field_value = 'type1', 'type2') ))
ORDER BY node_created DESC

Wrong part:
(field_data_field_list_field.field_list_field_value = 'type1', 'type2')

The attached patch solves the proble for me.

Best regards

#1 views-groups_filter_mutlivalue-2036473-1.patch884 bytesgrasmash
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es).
[ View ]
view_export_code.txt4.67 KBdendie
views_exposed_filter_groups.patch585 bytesdendie


grasmash’s picture

Issue summary:View changes
Status:Active» Needs review
new884 bytes
PASSED: [[SimpleTest]]: [MySQL] 1,664 pass(es).
[ View ]

I've experienced this problem in Views 7.x-3.7. It is caused by creating an exposed, grouped filter and selecting multiple values for one of the filter groups. This effectively breaks the view when such a filter value is selected.

I can verify that the attached patch does fix the issue. I've fixed the formatting issues in the patch and resubmitted.