Empty Multi-select Cannot Be Saved In Search Preferences Settings
Overview
I just found the problem in Contact Reference Options and Autocomplete Contact Search.
Reproduction steps
- Open Search Preferences Settings page.
- Untick all available boxes in Contact Reference Options except Contact Name - if there are no ticked boxes, enable some first
- Save and review the saved settings.
Current behaviour
When all boxes unticked, the field will not be saved.
Expected behaviour
Field saved.
Environment information
- CiviCRM: 5.22.0
- PHP: 7.1
- CMS: WordPress 5.3.2
Also tested on dmaster.
Comments
Empty field is not in the form data of the request.
Each ticked box in the form data will look like contact_reference_options[n]: 1
, where n is the index of the tick box.
Agileware ref: CIVICRM-1441