diff --git a/src/Bundle/ChillMainBundle/Entity/NewsItem.php b/src/Bundle/ChillMainBundle/Entity/NewsItem.php index 7acf2de86..78ca5bcf2 100644 --- a/src/Bundle/ChillMainBundle/Entity/NewsItem.php +++ b/src/Bundle/ChillMainBundle/Entity/NewsItem.php @@ -46,6 +46,7 @@ class NewsItem implements TrackCreationInterface, TrackUpdateInterface private string $content = ''; #[Assert\NotNull] + #[Assert\GreaterThanOrEqual('today')] #[Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: false)] private ?\DateTimeImmutable $startDate = null; diff --git a/src/Bundle/ChillMainBundle/Form/NewsItemType.php b/src/Bundle/ChillMainBundle/Form/NewsItemType.php index b6a93a0a0..6fe513055 100644 --- a/src/Bundle/ChillMainBundle/Form/NewsItemType.php +++ b/src/Bundle/ChillMainBundle/Form/NewsItemType.php @@ -29,6 +29,7 @@ class NewsItemType extends AbstractType ]) ->add('content', ChillTextareaType::class, [ 'required' => false, + 'empty_data' => '', ]) ->add( 'startDate',