Skip to content

Commit

Permalink
Remove translator if country list is used
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored Feb 21, 2024
1 parent fd9f279 commit d258e8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DI/ControlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ public static function addSelectCountry(
?string $lang = null,
) {
$lang ??= $form->getTranslator()?->getLocale();
$select = $form->addSelect($name);

if (!$items && class_exists(Country::class)) {
$items = Country::getList($lang);
$select->setTranslator(null);
}

return $form->addSelect($name)->setItems($items);
return $select->setItems($items);
}


Expand Down

0 comments on commit d258e8b

Please sign in to comment.