From 38e5d9c7cc4ccaab323fd007055385a9787d5648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 10 Apr 2024 16:08:35 +0200 Subject: [PATCH] fix task for symfony 5.4 --- src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php | 1 - src/Bundle/ChillTaskBundle/Entity/SingleTask.php | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php index 7a70e7ca6..c9bc4dd82 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php @@ -55,7 +55,6 @@ class DateIntervalType extends AbstractType { $builder ->add('n', IntegerType::class, [ - 'scale' => 0, 'constraints' => [ new GreaterThan([ 'value' => 0, diff --git a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php index a37f1dff7..a03da4beb 100644 --- a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php @@ -29,7 +29,6 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\Index(name: 'by_end_date', columns: ['end_date'])] class SingleTask extends AbstractTask { - #[Assert\Date] #[Serializer\Groups(['read'])] #[ORM\Column(name: 'end_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)] private ?\DateTime $endDate = null; @@ -44,7 +43,6 @@ class SingleTask extends AbstractTask private ?RecurringTask $recurringTask = null; #[Serializer\Groups(['read'])] - #[Assert\Date] #[Assert\Expression('value === null or this.getEndDate() === null or value < this.getEndDate()', message: 'The start date must be before the end date')] #[Assert\Expression('value === null or this.getWarningDate() === null or this.getWarningDate() > this.getStartDate()', message: 'The start date must be before warning date')] #[ORM\Column(name: 'start_date', type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]