Force that an currency has an iso currency code

Otherwise it will crash a lot of formatter code (and a currency which is not existing is not really useful)
This commit is contained in:
Jan Böhmer 2023-07-03 22:11:12 +02:00
parent 059110ae7a
commit 2d5f23271f
2 changed files with 4 additions and 3 deletions

View file

@ -42,7 +42,7 @@ class CurrencyAdminForm extends BaseEntityAdminForm
$is_new = null === $entity->getID();
$builder->add('iso_code', CurrencyType::class, [
'required' => false,
'required' => true,
'label' => 'currency.edit.iso_code',
'preferred_choices' => ['EUR', 'USD', 'GBP', 'JPY', 'CNY'],
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),