From 821018d4cefb3ffeec9f838d70f7fa24e53d0a83 Mon Sep 17 00:00:00 2001 From: Paul Andrieux Date: Mon, 18 Aug 2025 17:36:13 +0200 Subject: [PATCH] fix:add category and description fields for place user (#768) --- src/Form/Type/User/EditProfileFormType.php | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Form/Type/User/EditProfileFormType.php b/src/Form/Type/User/EditProfileFormType.php index 28e8562..6e5ee39 100644 --- a/src/Form/Type/User/EditProfileFormType.php +++ b/src/Form/Type/User/EditProfileFormType.php @@ -61,6 +61,22 @@ final class EditProfileFormType extends AbstractType ->add('submit', SubmitType::class, [ 'label' => self::I18N_PREFIX.'.submit', 'attr' => ['class' => 'btn-sm btn-primary'], + ]) + ->add('category', EntityType::class, [ + 'class' => Category::class, + 'query_builder' => fn (CategoryRepository $er) => $er->getHierarchy(), + 'group_by' => fn (Category $category) => $this->translator->trans(self::I18N_PREFIX.'.'.$category->getType()->value), + 'label' => self::I18N_PREFIX.'.category', + 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], + 'choice_label' => 'getNameWithIndent', + 'expanded' => false, + 'required' => false, + ]) + ->add('description', TextareaType::class, [ + 'label' => self::I18N_PREFIX.'.description', + 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], + 'attr' => ['style' => 'height: 120px'], + 'required' => false, ]); if ($user->isPlace()) { @@ -93,22 +109,6 @@ final class EditProfileFormType extends AbstractType 'attr' => [ 'class' => 'form-control-sm', ], - ]) - ->add('category', EntityType::class, [ - 'class' => Category::class, - 'query_builder' => fn (CategoryRepository $er) => $er->getHierarchy(), - 'group_by' => fn (Category $category) => $this->translator->trans(self::I18N_PREFIX.'.'.$category->getType()->value), - 'label' => self::I18N_PREFIX.'.category', - 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], - 'choice_label' => 'getNameWithIndent', - 'expanded' => false, - 'required' => false, - ]) - ->add('description', TextareaType::class, [ - 'label' => self::I18N_PREFIX.'.description', - 'label_attr' => ['class' => 'text-black fs-6 fw-normal'], - 'attr' => ['style' => 'height: 120px'], - 'required' => false, ]); }