From 7d785128234744e9b7243dc77ad3e20652ede319 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 17 Feb 2025 13:11:03 +0100 Subject: [PATCH] Change symfony form back to original --- .../ChillActivityBundle/Form/ActivityType.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 6eb74e4fa..28c607acd 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -20,7 +20,9 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillDateType; +use Chill\MainBundle\Form\Type\CommentType; use Chill\MainBundle\Form\Type\PickUserDynamicType; +use Chill\MainBundle\Form\Type\PrivateCommentType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Templating\TranslatableStringHelper; @@ -206,14 +208,17 @@ class ActivityType extends AbstractType } if ($activityType->isVisible('comment')) { - $builder->add('comment', HiddenType::class, [ - 'data' => '', + $builder->add('comment', CommentType::class, [ + 'label' => empty($activityType->getLabel('comment')) + ? 'activity.comment' : $activityType->getLabel('comment'), + 'required' => $activityType->isRequired('comment'), ]); } if ($activityType->isVisible('privateComment')) { - $builder->add('privateComment', HiddenType::class, [ - 'data' => '', + $builder->add('privateComment', PrivateCommentType::class, [ + 'label' => '' === $activityType->getLabel('privateComment') ? 'private comment' : $activityType->getPrivateCommentLabel(), + 'required' => false, ]); }