diff --git a/CHANGELOG.md b/CHANGELOG.md index 296f232b7..3f0f00749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to * [person] Add link to current household in person banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/484) * [person] Change 'personne' with 'usager' and '&' with 'ET' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/499) * [thirdparty] Add parameter condition to display centers or not (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/500) +* [phonenumber] Remove placeholder in phonenumber field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/496) ## Test releases diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php index 547782943..2580058e8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php @@ -16,9 +16,7 @@ use libphonenumber\PhoneNumberUtil; use Misd\PhoneNumberBundle\Form\Type\PhoneNumberType; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Form\AbstractType; -use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\OptionsResolver; -use function array_key_exists; class ChillPhoneNumberType extends AbstractType { @@ -37,21 +35,7 @@ class ChillPhoneNumberType extends AbstractType $resolver ->setDefault('default_region', $this->defaultCarrierCode) ->setDefault('format', PhoneNumberFormat::NATIONAL) - ->setDefault('type', \libphonenumber\PhoneNumberType::FIXED_LINE_OR_MOBILE) - ->setNormalizer('attr', function (Options $options, $value) { - if (array_key_exists('placeholder', $value)) { - return $value; - } - - $examplePhoneNumber = $this->phoneNumberUtil->getExampleNumberForType($this->defaultCarrierCode, $options['type']); - - return array_merge( - $value, - [ - 'placeholder' => PhoneNumberUtil::getInstance()->format($examplePhoneNumber, $options['format']), - ] - ); - }); + ->setDefault('type', \libphonenumber\PhoneNumberType::FIXED_LINE_OR_MOBILE); } public function getParent()