"Sort" on CCK multiple-chekbox fields gives error, creates wrong join
| Project: | Content Construction Kit (CCK) |
| Version: | 5.x-1.6 |
| Component: | Views Integration |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
When trying to add a sortable field of the CCK type multiple-checkbox (in this case, simply with lists of items, and not int key = text value), the "sort" feature, when clicked on, creates an SQL error, specifically a column not found in the ORDER BY clause.
Multiple-checkbox type fields don't really NEED to be sorted, but this does produce a nasty SQL error.
Ideally, at least multiple-checkbox type fields should not allow for the possibility of sorting.
Here the query in error from dev queries:
SELECT node.nid, node_data_field_first_name.field_first_name_value AS node_data_field_first_name_field_first_name_value, node_data_field_family_name.field_family_name_value AS node_data_field_family_name_field_family_name_value, node_data_field_profile_photo.field_profile_photo_fid AS node_data_field_profile_photo_field_profile_photo_fid, node_data_field_profile_photo.field_profile_photo_title AS node_data_field_profile_photo_field_profile_photo_title, node_data_field_profile_photo.field_profile_photo_alt AS node_data_field_profile_photo_field_profile_photo_alt, node_data_field_name.field_name_first AS node_data_field_name_field_name_first, node_data_field_name.field_name_middle AS node_data_field_name_field_name_middle, node_data_field_name.field_name_last AS node_data_field_name_field_name_last FROM {node} node LEFT JOIN {content_type_nodeprofile_student_users} node_data_field_roleid ON node.vid = node_data_field_roleid.vid LEFT JOIN {content_type_nodeprofile_student_users} node_data_field_first_name ON node.vid = node_data_field_first_name.vid LEFT JOIN {content_type_nodeprofile_student_users} node_data_field_family_name ON node.vid = node_data_field_family_name.vid LEFT JOIN {content_field_industries} node_data_field_industries ON node.vid = node_data_field_industries.vid LEFT JOIN {content_type_nodeprofile_student_users} node_data_field_profile_photo ON node.vid = node_data_field_profile_photo.vid LEFT JOIN {content_type_nodeprofile_student_users} node_data_field_name ON node.vid = node_data_field_name.vid WHERE (node_data_field_roleid.field_roleid_value = '1') AND (node.type IN ('nodeprofile_student_users')) ORDER BY node_data_field_industries_field_industries_value ASC
Attachment: the view export.
| Attachment | Size |
|---|---|
| viewsBugReportExport.txt | 2.87 KB |

#1
You can't sort on a grouped multiple value field. If you ungroup the field you can sort on it, but you will see a table row for each individual value.