From 09ffa0c15bc6fac2ce800906108147db88470be2 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 2 Mar 2015 03:49:55 +0530 Subject: [PATCH] optimiation changes --- CRM/Upgrade/Incremental/php/FourFive.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FourFive.php b/CRM/Upgrade/Incremental/php/FourFive.php index 537095fd0b..47c6152d97 100755 --- a/CRM/Upgrade/Incremental/php/FourFive.php +++ b/CRM/Upgrade/Incremental/php/FourFive.php @@ -347,15 +347,18 @@ DROP KEY `{$dao->CONSTRAINT_NAME}`"; if (!is_null($key)) { $op = 'or'; unset($data_value[$key]); - if (count($data_value) == 0) { - $customOption = CRM_Core_BAO_CustomOption::getCustomOption($fieldID); - foreach ($customOption as $option) { - $data_value[] = CRM_Utils_Array::value('value', $option); - } - } } } + //If only Or operator has been chosen means we need to select all values and + //so to execute OR operation between these values according to new data structure + if (count($data_value) == 0) { + $customOption = CRM_Core_BAO_CustomOption::getCustomOption($fieldID); + foreach ($customOption as $option) { + $data_value[] = CRM_Utils_Array::value('value', $option); + } + } + // Add new key for the operator. $formValues["${field}_operator"] = $op; -- 2.25.1