Index: trunk/kernel/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r1821 -r1875 --- trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 1821) +++ trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 1875) @@ -49,16 +49,21 @@ } } - $this->country_state_pairs = Array('Comm_Country' => 'Comm_State', 'Comm_Shipping_Country' => 'Comm_Shipping_State'); + $submitted_vars = $this->Application->GetVar('conf'); - if ( isset($this->country_state_pairs[$object->GetDBField('VariableName')]) ){ - $this->state_country_codes[$this->country_state_pairs[$object->GetDBField('VariableName')]]=$object->GetDBField('VariableValue'); - } + //$this->country_state_pairs = Array('Comm_Country' => 'Comm_State', 'Comm_Shipping_Country' => 'Comm_Shipping_State'); + $this->state_country_pairs = Array('Comm_State' => 'Comm_Country', 'Comm_Shipping_State' => 'Comm_Shipping_Country'); - if( isset($this->state_country_codes[$object->GetDBField('VariableName')]) ) - { + if ( isset($this->state_country_pairs[$object->GetDBField('VariableName')]) ){ + //$this->state_country_codes[$this->country_state_pairs[$object->GetDBField('VariableName')]]=$object->GetDBField('VariableValue'); + $check_state = $object->GetDBField('VariableValue'); + $check_country = $submitted_vars[$this->state_country_pairs[$object->GetDBField('VariableName')]]['VariableValue']; + //} + + //if( isset($this->state_country_codes[$object->GetDBField('VariableName')]) ) + //{ $cs_helper = &$this->Application->recallObject('CountryStatesHelper'); - $state_valid_code = $cs_helper->CheckState( $object->GetDBField('VariableValue'), $this->state_country_codes[$object->GetDBField('VariableName')] ); + $state_valid_code = $cs_helper->CheckState( $check_state, $check_country ); if ($state_valid_code !== false) { $object->SetDBField('VariableValue', $state_valid_code);