Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Feb 1, 2021
1 parent 71fb8be commit 5690a1b
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
namespace Zikula\Bundle\FormExtensionBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
use Symfony\Component\Form\Extension\Core\Type\LanguageType;
use Symfony\Component\Form\Extension\Core\Type\LocaleType as SfLocaleType;
use Symfony\Component\Form\Extension\Core\Type\TimezoneType;
//use Symfony\Component\Form\Extension\Core\Type\CountryType;
//use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
//use Symfony\Component\Form\Extension\Core\Type\LanguageType;
//use Symfony\Component\Form\Extension\Core\Type\LocaleType as SfLocaleType;
//use Symfony\Component\Form\Extension\Core\Type\TimezoneType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;
Expand Down Expand Up @@ -53,7 +53,8 @@ public function buildForm(FormBuilderInterface $builder, array $options = [])
foreach ($this->dynamicFieldsContainer->getDynamicFieldsSpecification() as $fieldSpecification) {
$fieldOptions = $fieldSpecification->getFormOptions();
$fieldOptions['label'] = $fieldOptions['label'] ?? $fieldSpecification->getLabel($this->translator->getLocale());
$fieldOptions = $this->removeChoiceLoader($fieldSpecification->getFormType(), $fieldOptions);
// to be removed after it has been confirmed that it became unneeded
//$fieldOptions = $this->removeChoiceLoader($fieldSpecification->getFormType(), $fieldOptions);

$prefix = $fieldSpecification->getPrefix();
$prefix = null !== $prefix && '' !== $prefix ? $prefix . ':' : '';
Expand All @@ -64,7 +65,8 @@ public function buildForm(FormBuilderInterface $builder, array $options = [])

/**
* Symfony 4+ requires the choice_loader be nullified for certain form types.
*/
* to be removed after it has been confirmed that it became unneeded
* /
private function removeChoiceLoader($type, $fieldOptions): array
{
if (in_array($type, [
Expand All @@ -78,7 +80,7 @@ private function removeChoiceLoader($type, $fieldOptions): array
}
return $fieldOptions;
}
}*/

public function getBlockPrefix()
{
Expand Down

0 comments on commit 5690a1b

Please sign in to comment.