diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 7b9f24705..0fa2fdf76 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PrivateCommentType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig index 8e078702c..6f6e1fe53 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig @@ -81,10 +81,13 @@ {% endif %} {%- if form.comment is defined -%} - {# TODO .. public and private #} {{ form_row(form.comment) }} {% endif %} +{%- if form.privateComment is defined -%} + {{ form_row(form.privateComment) }} +{% endif %} + {%- if form.attendee is defined -%} {{ form_row(form.attendee) }} {% endif %} diff --git a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php index f3e35bb1f..f7fd41cb5 100644 --- a/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php +++ b/src/Bundle/ChillMainBundle/Entity/Embeddable/PrivateCommentEmbeddable.php @@ -51,7 +51,10 @@ class PrivateCommentEmbeddable public function merge(PrivateCommentEmbeddable $newComment): self { - $mergedComments = $newComment->getComments() + $this->getComments(); + + $currentComments = null === $this->getComments() ? [] : $this->getComments(); + + $mergedComments = $newComment->getComments() + $currentComments; $this->setComments($mergedComments);