[Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error

This commit is contained in:
Julien Fastré 2022-04-20 18:33:08 +02:00
parent 44b537f05e
commit e246ccbcd9
3 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ and this project adheres to
* [activity]: Ignore thirdparties when creating a social action via an activity (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/573)
* [parcours]: change wording of warning message and button when user is not associated to a household yet (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/590#note_918370943)
* [Accompanying period work evaluations] list documents associated to a work by creation date, and then by id, from the most recent to older
* [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error
## Test releases

View File

@ -19,6 +19,7 @@ use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
@ -40,6 +41,8 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Column(type="text")
* @Groups({"read", "write"})
* @Assert\NotBlank()
* @Assert\NotNull()
*/
private $content;

View File

@ -40,6 +40,7 @@
{% endif %}
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_errors(form.content) }}
{{ form_widget(form.content) }}
<ul class="record_actions">
<li>