Index: location.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.module,v
retrieving revision 1.222.2.38
diff -u -p -r1.222.2.38 location.module
--- location.module	13 Jun 2010 09:12:32 -0000	1.222.2.38
+++ location.module	23 Jun 2010 18:45:01 -0000
@@ -565,9 +565,14 @@ function location_locationapi(&$obj, $op
       );
 
     case 'validate':
-      if (!empty($obj['country'])) {
+      $element = $a3;
+      $settings = $element['location_settings']['#value'];
+      $country = $settings['form']['fields']['country']['collect'] == 4
+        ? $settings['form']['fields']['country']['default']
+        : (!empty($obj['country']) ? $obj['country'] : FALSE);
+      if (!empty($country)) {
         if (!empty($obj['province'])) {
-          $provinces = location_get_provinces($obj['country']);
+          $provinces = location_get_provinces($country);
           $found = FALSE;
           $p = strtoupper($obj['province']);
           foreach ($provinces as $k => $v) {
@@ -576,8 +581,15 @@ function location_locationapi(&$obj, $op
               break;
             }
           }
-          if (!$found) {
-            form_error($a3['province'], t('The specified province was not found in the specified country.'));
+          if (!empty($provinces) && !$found) {
+            if ($settings['form']['fields']['country']['collect'] == 4) {
+              // If "Force default" is enabled for country, then there was no
+              // country specified. Display a different error message that case.
+              form_error($a3['province'], t('The specified province was not found.'));
+            }
+            else {
+              form_error($a3['province'], t('The specified province was not found in the specified country.'));
+            }
           }
         }
       }
