From abdfe49c3330e44e50234e04b07492de19f88d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 25 Apr 2025 14:38:32 +0200 Subject: [PATCH] Fix fixedDate logic to handle empty string check Previously, the `fixedDate` logic did not account for empty strings, which could lead to unexpected behavior. This change ensures that `fixedDate` is validated for both null and empty string values before processing. --- .../Export/Migrator/SavedExportOptionsMigrator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Export/Migrator/SavedExportOptionsMigrator.php b/src/Bundle/ChillMainBundle/Export/Migrator/SavedExportOptionsMigrator.php index de72a30ac..c2360e13b 100644 --- a/src/Bundle/ChillMainBundle/Export/Migrator/SavedExportOptionsMigrator.php +++ b/src/Bundle/ChillMainBundle/Export/Migrator/SavedExportOptionsMigrator.php @@ -113,7 +113,7 @@ class SavedExportOptionsMigrator return null; } - $fixedDate = null !== ($formData['fixedDate'] ?? null) ? + $fixedDate = null !== ($formData['fixedDate'] ?? null) && "" !== $formData['fixedDate'] ? \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', sprintf('%s 00:00:00', $formData['fixedDate']), new \DateTimeZone(date_default_timezone_get())) : null; return (new RollingDate(