Skip to content

Commit

Permalink
Merge pull request #1481 from dpfaffenbauer/issues/1480
Browse files Browse the repository at this point in the history
[OrderBundle, LocaleBundle] fix backend order-creation localeCode selection
  • Loading branch information
dpfaffenbauer authored Sep 22, 2020
2 parents ba325c6 + 9e6cd31 commit 951c034
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/CoreShop/Bundle/LocaleBundle/Form/Type/LocaleChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,21 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'choices' => function (Options $options) {
'choices' => static function (Options $options) {
$locales = Tool::getValidLanguages();

usort($locales, function ($a, $b): int {
usort($locales, static function ($a, $b): int {
return $a <=> $b;
});

return $locales;
},
'choice_value' => 'id',
'choice_label' => 'name',
'choice_value' => static function ($value) {
return $value;
},
'choice_label' => static function($value) {
return $value;
},
'choice_translation_domain' => false,
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ coreshop.order.sale.create.step.base = Class.create(coreshop.order.sale.create.a
isValid: function () {
var values = this.getValues();

return values.currency && values.language;
return values.currency && values.localeCode;
},

getPriority: function () {
Expand Down Expand Up @@ -81,7 +81,7 @@ coreshop.order.sale.create.step.base = Class.create(coreshop.order.sale.create.a
},
new Ext.form.ComboBox({
fieldLabel: t('language'),
name: "language",
name: "localeCode",
store: languageStore,
editable: false,
triggerAction: 'all',
Expand Down

0 comments on commit 951c034

Please sign in to comment.