mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix form and take null cases into account
This commit is contained in:
parent
784a725ce3
commit
416a88b93d
@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\MainBundle\Form\Type\CommentType;
|
use Chill\MainBundle\Form\Type\CommentType;
|
||||||
|
use Chill\MainBundle\Form\Type\PrivateCommentType;
|
||||||
use Chill\MainBundle\Form\Type\ScopePickerType;
|
use Chill\MainBundle\Form\Type\ScopePickerType;
|
||||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
|
@ -81,10 +81,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if form.comment is defined -%}
|
{%- if form.comment is defined -%}
|
||||||
{# TODO .. public and private #}
|
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{%- if form.privateComment is defined -%}
|
||||||
|
{{ form_row(form.privateComment) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{%- if form.attendee is defined -%}
|
{%- if form.attendee is defined -%}
|
||||||
{{ form_row(form.attendee) }}
|
{{ form_row(form.attendee) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -51,7 +51,10 @@ class PrivateCommentEmbeddable
|
|||||||
|
|
||||||
public function merge(PrivateCommentEmbeddable $newComment): self
|
public function merge(PrivateCommentEmbeddable $newComment): self
|
||||||
{
|
{
|
||||||
$mergedComments = $newComment->getComments() + $this->getComments();
|
|
||||||
|
$currentComments = null === $this->getComments() ? [] : $this->getComments();
|
||||||
|
|
||||||
|
$mergedComments = $newComment->getComments() + $currentComments;
|
||||||
|
|
||||||
$this->setComments($mergedComments);
|
$this->setComments($mergedComments);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user