CRM-18125 QA fix
authordeb.monish <monish.deb@webaccessglobal.com>
Mon, 7 Mar 2016 07:20:27 +0000 (12:50 +0530)
committerdeb.monish <monish.deb@webaccessglobal.com>
Mon, 7 Mar 2016 07:20:27 +0000 (12:50 +0530)
CRM/Contact/BAO/Query.php

index f7b9fd4fea49ad7cd6425e0f319ee81d91ac0d7d..f0ff34aeb6f5d924f8f08fd6550f052c1ec5b258 100644 (file)
@@ -4469,16 +4469,14 @@ civicrm_relationship.is_permission_a_b = 0
    * @param array $formValues
    */
   public static function filterCountryFromValuesIfStateExists(&$formValues) {
-    if (!empty($formValues['country'])) {
-      if (isset($formValues['state_province'])) {
-        // The use of array map sanitises the data by ensuring we are dealing with integers.
-        $states = implode(', ', array_map('intval', $formValues['state_province']));
-        $countryList = CRM_Core_DAO::singleValueQuery(
-          "SELECT GROUP_CONCAT(country_id) FROM civicrm_state_province WHERE id IN ($states)"
-        );
-        if ($countryList == $formValues['country']) {
-          unset($formValues['country']);
-        }
+    if (!empty($formValues['country']) && !empty($formValues['state_province'])) {
+      // The use of array map sanitises the data by ensuring we are dealing with integers.
+      $states = implode(', ', array_map('intval', $formValues['state_province']));
+      $countryList = CRM_Core_DAO::singleValueQuery(
+        "SELECT GROUP_CONCAT(country_id) FROM civicrm_state_province WHERE id IN ($states)"
+      );
+      if ($countryList == $formValues['country']) {
+        unset($formValues['country']);
       }
     }
   }
@@ -5869,13 +5867,13 @@ AND   displayRelType.is_active = 1
       $pseudoOptions = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
     }
     elseif ($fieldName == 'country_id') {
-      $pseduoOptions = CRM_Core_PseudoConstant::country();
+      $pseudoOptions = CRM_Core_PseudoConstant::country();
     }
     elseif ($fieldName == 'county_id') {
-      $pseduoOptions = CRM_Core_PseudoConstant::county();
+      $pseudoOptions = CRM_Core_PseudoConstant::county();
     }
     elseif ($fieldName == 'world_region') {
-      $pseduoOptions = CRM_Core_PseudoConstant::worldRegion();
+      $pseudoOptions = CRM_Core_PseudoConstant::worldRegion();
     }
     elseif ($daoName == 'CRM_Event_DAO_Event' && $fieldName == 'id') {
       $pseudoOptions = CRM_Event_BAO_Event::getEvents(0, $fieldValue, TRUE, TRUE, TRUE);