Details
Description
The Group ID filter in the CiviCRM views module has the following issues:
- the generated SQL query is incorrect. When including a group, the generated WHERE clause is: (civicrm_group.id = {group_id}), where it should really be (civicrm_group.id = {group_id} AND civicrm_group.status = 'Added'). When excluding a group the generated WHERE clause is: (civicrm_group.id != {group_id}), where it should really be (civicrm_group.id IS NULL OR (civicrm_group.id = {group_id} AND civicrm_group.status = 'Added')) as we do not want to exclude contacts that are not part of any group.
- in the UI, the groups are specified by group_id, which is not user friendly. It would be much better to pick the groups by name
- in the UI, there is no way to include or exclude multiple groups together in the query
- also see linked ticket listing more issues.
This seems to stem from the fact that the group selection and filter is done as a standard numeric field with Drupal view. It would be much better if we bundled our own UI, allowing to include or exclude multiple groups, and generated our own resulting SQL where clause.
Attachments
Issue Links
- supplements
-
CRM-20006 Drupal Views : relationships for standard groups
- Open