From 9406ae0b281d86d3b78193b8cbc02fd7df3d160f Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 13 Oct 2015 19:52:33 +0530 Subject: [PATCH] ensure CRM_Contact_BAO_SavedSearch::getFormValues is only used to fetch as Search Form default --- CRM/Contact/BAO/SavedSearch.php | 2 +- CRM/Upgrade/Incremental/php/FourFour.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index ccfe4f917b..2b910db03b 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -89,7 +89,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * The id of the saved search. * * @return array - * the values of the posted saved search + * the values of the posted saved search used as default values in various Search Form */ public static function &getFormValues($id) { $fv = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'form_values'); diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index eb541d2037..3b68ed460e 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -429,7 +429,10 @@ ALTER TABLE civicrm_dashboard $dao = new CRM_Contact_DAO_SavedSearch(); $dao->find(); while ($dao->fetch()) { - $formValues = CRM_Contact_BAO_SavedSearch::getFormValues($dao->id); + $formValues = NULL; + if (!empty($dao->form_values)) { + $formValues = unserialize($dao->form_values); + } if (!empty($formValues['mapper'])) { foreach ($formValues['mapper'] as $key => $value) { foreach ($value as $k => $v) { -- 2.25.1