From 69a996691047cae2d6ef0fb4984312929ea586e0 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 18 Jan 2023 20:03:19 +0530 Subject: [PATCH] added SQL_MODE for invalid dates in db backup --- classes/PrestaShopBackup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/PrestaShopBackup.php b/classes/PrestaShopBackup.php index adb0f4edd..6bc12601e 100644 --- a/classes/PrestaShopBackup.php +++ b/classes/PrestaShopBackup.php @@ -218,7 +218,8 @@ class PrestaShopBackupCore $this->id = realpath($backupfile); fwrite($fp, '/* Backup for '.Tools::getHttpHost(false, false).__PS_BASE_URI__."\n * at ".date($date)."\n */\n"); - fwrite($fp, "\n".'SET NAMES \'utf8\';'."\n\n"); + fwrite($fp, "\n".'SET NAMES \'utf8\';'); + fwrite($fp, "\n".'SET SQL_MODE=\'ALLOW_INVALID_DATES\';'."\n\n"); // Find all tables $tables = Db::getInstance()->executeS('SHOW TABLES');