Groups filter hack for smaller groups listings
authorAndrew Engelbrecht <andrew@fsf.org>
Fri, 15 Sep 2017 20:15:10 +0000 (16:15 -0400)
committerMichael McMahon <michael@fsf.org>
Wed, 4 May 2022 20:32:59 +0000 (16:32 -0400)
commit2bb3ba1fc67c03d746f0e51dbacad869a6a3140f
tree368d5be02f978c1d6dfc9c02ef6f76885597faaf
parentf10bdb8e45b6e7c980ad2c951ac4edf9fce63544
Groups filter hack for smaller groups listings

This change is a dirty hack that lets site admins filter the "Contacts
Group(s)" field output in select profiles. This reduces overwhem for
users when they are making a donation or filling out a form with the
Groups signup field. This is preferable to using a custom field with
smart groups because the Groups field provides double opt-in, while
custom fields do not.

The filter is controlled via a json string stored in a drupal variable
that can be set with drush like so:

drush vset --format=string groups_field_filters "{...}"

See the documentation marked with "sudoman hack" in
CRM/Contact/Form/Edit/TagsAndGroups.php for an example.
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Event/Form/Registration/Confirm.php
CRM/Profile/Form.php