From e2146332dce04777d88fc28230c1cf8ed093342b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Wed, 10 Jan 2024 23:18:02 +0100 Subject: [PATCH] Fixed problems with invalid dates during PartKeepr import with MySQL See issue #473 --- .../PartKeeprImporter/PKImportHelperTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php index 70237114..1d77d461 100644 --- a/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php +++ b/src/Services/ImportExportSystem/PartKeeprImporter/PKImportHelperTrait.php @@ -224,7 +224,7 @@ trait PKImportHelperTrait */ protected function setCreationDate(TimeStampableInterface $entity, ?string $datetime_str) { - if ($datetime_str) { + if ($datetime_str !== null && $datetime_str !== '' && $datetime_str !== '0000-00-00 00:00:00') { $date = new \DateTime($datetime_str); } else { $date = null; //Null means "now" at persist time