Merge pull request #15181 from seamuslee001/mailing_search_date_picker_conversion
[civicrm-core.git] / CRM / Contact / Form / Task.php
index 397a8d50a99fecd3ed45a7bd6b4625fa4cfd5a05..2f049dda00370439d17a2d0077563dccd6bddbcb 100644 (file)
@@ -543,7 +543,10 @@ class CRM_Contact_Form_Task extends CRM_Core_Form_Task {
         'group_type' => ['2' => 1],
         // queryParams have been preprocessed esp WRT any entity reference fields - see +
         // https://github.com/civicrm/civicrm-core/pull/13250
-        'form_values' => $this->get('queryParams'),
+        // Advanced search sets queryParams, for builder you need formValues.
+        // This is kinda fragile but ....  see CRM_Mailing_Form_Task_AdhocMailingTest for test effort.
+        // Moral never touch anything ever again and the house of cards will stand tall, unless there is a breeze
+        'form_values' => $this->get('isSearchBuilder') ? $this->get('formValues') : $this->get('queryParams'),
         'saved_search_id' => $ssId,
         'search_custom_id' => $this->get('customSearchID'),
         'search_context' => $this->get('context'),