diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 7e51c4c4..889bc7c8 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -62,6 +62,7 @@ class Currency extends AbstractStructuralDBElement * @var string the 3-letter ISO code of the currency */ #[Assert\Currency] + #[Assert\NotBlank] #[Groups(['extended', 'full', 'import'])] #[ORM\Column(type: Types::STRING)] protected string $iso_code = ""; @@ -113,12 +114,12 @@ class Currency extends AbstractStructuralDBElement * * @return string */ - public function getIsoCode(): ?string + public function getIsoCode(): string { return $this->iso_code; } - public function setIsoCode(?string $iso_code): self + public function setIsoCode(string $iso_code): self { $this->iso_code = $iso_code; diff --git a/src/Form/AdminPages/CurrencyAdminForm.php b/src/Form/AdminPages/CurrencyAdminForm.php index a3514b80..0fab055d 100644 --- a/src/Form/AdminPages/CurrencyAdminForm.php +++ b/src/Form/AdminPages/CurrencyAdminForm.php @@ -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),