Error Code(0): Error: Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_added' at row 1
Error No: 1292
ALTER TABLE `xx18fgt_api` CHANGE `date_added` `date_added` DATETIME NOT NULL AFTER `status` in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Progress
Error Code(0): Error: Invalid default value for 'date_start'
Error No: 1067
ALTER TABLE `xx18fgt_coupon` ENGINE = `MyISAM` in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Error Code(0): Error: Invalid default value for 'date_start'
Error No: 1067
CREATE TABLE `xx18fgt_coupon` ( `coupon_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `code` varchar(20) NOT NULL, `type` char(1) NOT NULL, `discount` decimal(15,4) NOT NULL, `logged` tinyint(1) NOT NULL, `shipping` tinyint(1) NOT NULL, `total` decimal(15,4) NOT NULL, `date_start` date NOT NULL DEFAULT '0000-00-00', `date_end` date NOT NULL DEFAULT '0000-00-00', `uses_total` int(11) NOT NULL, `uses_customer` varchar(11) NOT NULL, `status` tinyint(1) NOT NULL, `date_added` datetime NOT NULL, PRIMARY KEY (`coupon_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Error No: 1292
ALTER TABLE `xx18fgt_api` CHANGE `date_added` `date_added` DATETIME NOT NULL AFTER `status` in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Progress
Error Code(0): Error: Invalid default value for 'date_start'
Error No: 1067
ALTER TABLE `xx18fgt_coupon` ENGINE = `MyISAM` in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Error Code(0): Error: Invalid default value for 'date_start'
Error No: 1067
CREATE TABLE `xx18fgt_coupon` ( `coupon_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `code` varchar(20) NOT NULL, `type` char(1) NOT NULL, `discount` decimal(15,4) NOT NULL, `logged` tinyint(1) NOT NULL, `shipping` tinyint(1) NOT NULL, `total` decimal(15,4) NOT NULL, `date_start` date NOT NULL DEFAULT '0000-00-00', `date_end` date NOT NULL DEFAULT '0000-00-00', `uses_total` int(11) NOT NULL, `uses_customer` varchar(11) NOT NULL, `status` tinyint(1) NOT NULL, `date_added` datetime NOT NULL, PRIMARY KEY (`coupon_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci in /home/admin/web/mycy.com/public_html/d/system/library/db/mysqli.php on line 41
Hi!
I have the same issue when I tried to update from 3.0.3.2 to 3.0.3.7.
My PHP Version is 7.4 and my theme is Journal 3 (According to last changelog statement the last version is php 7.4 and 3.0.3.7 compatible).
I verified my files permission but They are Ok.
Did you get any solution?
I have the same issue when I tried to update from 3.0.3.2 to 3.0.3.7.
Code: Select all
Error Code(0): Error: Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_added' at row 1Error No: 1292ALTER TABLE `modification` CHANGE `date_added` `date_added` DATETIME NOT NULL AFTER `status` in /home2/xxxxx/public_html/testing/upgrade/system/library/db/mysqli.php on line 41
I verified my files permission but They are Ok.
Did you get any solution?
https://github.com/opencart/opencart/is ... -774502931
Try to change this line in system/library/db/mysqli.php
Old:
$this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION'");
New:
$this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION'");
See documentation at https://dev.mysql.com/doc/refman/8.0/en ... r_sql_mode for details.
Try to change this line in system/library/db/mysqli.php
Old:
$this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_ENGINE_SUBSTITUTION'");
New:
$this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION'");
See documentation at https://dev.mysql.com/doc/refman/8.0/en ... r_sql_mode for details.
I had the same issue during upgrade and this works.
After upgrade another problem occurred and that was that within both config files the DIR_STORAGE line was removed.
Added this line again and the site was up and running again.
my case > config.php
Thank you!
After upgrade another problem occurred and that was that within both config files the DIR_STORAGE line was removed.
Added this line again and the site was up and running again.
my case > config.php
Code: Select all
define('DIR_STORAGE','/var/www/vhosts/domainname.com/storage/');
Same problem here updating from 3.0.3.2 to 3.0.3.7. I got the same error message trying to install the update "Incorrect datetime value".
I removed the "NO_ZERO_DATE," from the file mysqli.php as suggested which made the update go through.
I also double checked the "DIR_STORAGE" config variable, which was still present after the update.
It seemed to work, although when I did a refresh in the extensions admin section the shop wasn't loading anymore and just presented an empty page, on the frontend and on the backend. Any additional solutions?
Thank you very much
I removed the "NO_ZERO_DATE," from the file mysqli.php as suggested which made the update go through.
I also double checked the "DIR_STORAGE" config variable, which was still present after the update.
It seemed to work, although when I did a refresh in the extensions admin section the shop wasn't loading anymore and just presented an empty page, on the frontend and on the backend. Any additional solutions?
Thank you very much
Check your OpenCart and PHP error logs.esprit1st wrote: ↑Tue Apr 06, 2021 5:13 amSame problem here updating from 3.0.3.2 to 3.0.3.7. I got the same error message trying to install the update "Incorrect datetime value".
I removed the "NO_ZERO_DATE," from the file mysqli.php as suggested which made the update go through.
I also double checked the "DIR_STORAGE" config variable, which was still present after the update.
It seemed to work, although when I did a refresh in the extensions admin section the shop wasn't loading anymore and just presented an empty page, on the frontend and on the backend. Any additional solutions?
Thank you very much
I am getting this error message:
Code: Select all
PHP Fatal error:
Uncaught Error: Class 'Twig\\Loader\\ArrayLoader' not found in /var/www/www.domain.com_storage/modification/system/library/template/twig.php:35
Stack trace:
#0 /var/www/www.domain.com/system/library/template.php(51): Template\\Twig->render()
#1 /var/www/www.domain.com_storage/modification/system/engine/loader.php(125): Template->render()
#2 /var/www/www.domain.com/admin/controller/common/header.php(79): Loader->view()
#3 /var/www/www.domain.com_storage/modification/system/engine/action.php(79): ControllerCommonHeader->index()
#4 /var/www/www.domain.com_storage/modification/system/engine/loader.php(48): Action->execute()
#5 /var/www/www.domain.com/admin/controller/marketplace/modification.php(763): Loader->controller()
#6 /var/www/www.domain.com/admin/controller/marketplace/modification.php(17): ControllerMarketplaceModification->getList()
#7 /var/www/www.domain.com_storage/modification/system/engine/action.php(79): Controll in /var/www/www.domain.com_storage/modification/system/library/template/twig.php on line 35, referer: https://www.domain.com/admin/index.php?route=marketplace/modification&user_token=xyz
The storage folder has changed. You may need to move the contents of the new storage folder under system to your storage location. Always make a backup before anything you do.
Oh, I have backups. Doing this update for the 3rd time.
Thanks for that. It seemed it had to do with the storage folder. I copied the contents of the /system/storage folder into my storage folder and also had to do a chmod 777 on the folder. Then it worked.
Thanks!!
Thanks for that. It seemed it had to do with the storage folder. I copied the contents of the /system/storage folder into my storage folder and also had to do a chmod 777 on the folder. Then it worked.
Thanks!!
Ok, I am using the most recent version of opencart, which is 3.0.3.7. My question: Will I need to remove the from the file mysqli.php when a new version of opencart is available? I mean, I experienced this error while still using a fresh install and the most recent version. If I adjust the core files to resolve errors, how will I deal with the errors if they arise again when new files override the current files after an update? Shall I keep track of everything I am adjusting and adjust it again after every update?
Code: Select all
NO_ZERO_DATE
It's been remove from the code base. Any new versions should have the change included.
https://github.com/opencart/opencart/co ... 76e934b75e
https://github.com/opencart/opencart/co ... 76e934b75e
Who is online
Users browsing this forum: No registered users and 316 guests