Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -r9416 -r9419 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 9416) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 9419) @@ -1327,7 +1327,7 @@ $this->Application->EmailEventAdmin($email_event); } } - + /** * OnAfterConfigRead for users * @@ -1336,15 +1336,14 @@ function OnAfterConfigRead(&$event) { parent::OnAfterConfigRead($event); - - // update Country SQL - $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); + $first_country = $this->Application->ConfigValue('User_Default_Registration_Country'); - - if ($first_country) { - $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); + if ($first_country) { + // update user country dropdown sql + $fields = $this->Application->getUnitOption($event->Prefix, 'Fields'); + $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); - } + } } }