CRM-15215 - Fix api address validation
authorColeman Watts <coleman@civicrm.org>
Mon, 1 Sep 2014 12:50:06 +0000 (13:50 +0100)
committerColeman Watts <coleman@civicrm.org>
Mon, 1 Sep 2014 12:50:06 +0000 (13:50 +0100)
CRM/Core/BAO/Address.php

index 5285d7811c551261ff366ab3470108ff34f5a877..4482d3b5d20a674cd8e19c028cc6a2e008c376b8 100644 (file)
@@ -1185,7 +1185,7 @@ SELECT is_primary,
             $props['country_id'] = $config->defaultContactCountry;
           }
         }
-        if (!empty($props['country_id'])) {
+        if (!empty($props['country_id']) && $context !== 'validate') {
           $params['condition'] = 'country_id IN (' . implode(',', (array) $props['country_id']) . ')';
         }
         break;
@@ -1207,4 +1207,4 @@ SELECT is_primary,
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
-}
\ No newline at end of file
+}