Closed laurent-bientz closed 1 year ago
Hi,
In a FormType, if we have 'label' => false, it's normalized by the form name instead of null (or a blank string if we want to follow the RFC).
'label' => false
null
In your code:
protected function addLabel(FormInterface $form, array $schema) { $translationDomain = $form->getConfig()->getOption('translation_domain'); if ($label = $form->getConfig()->getOption('label')) { $schema['title'] = $this->translator->trans($label, [], $translationDomain); } else { $schema['title'] = $this->translator->trans($form->getName(), [], $translationDomain); } return $schema; }
should be changed by:
protected function addLabel(FormInterface $form, array $schema) { $translationDomain = $form->getConfig()->getOption('translation_domain'); if ($label = $form->getConfig()->getOption('label')) { $schema['title'] = $this->translator->trans($label, [], $translationDomain); } elseif (false === $form->getConfig()->getOption('label')) { $schema['title'] = ''; } else { $schema['title'] = $this->translator->trans($form->getName(), [], $translationDomain); } return $schema; }
Hi,
In a FormType, if we have
'label' => false
, it's normalized by the form name instead ofnull
(or a blank string if we want to follow the RFC).In your code:
should be changed by: