Post by misceotw » Thu Feb 25, 2021 11:45 pm

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

Newbie

Posts

Joined
Sun Jul 29, 2018 4:35 pm

Post by ventienda » Sat Feb 27, 2021 3:27 am

Hi!

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
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?

User avatar
New member

Posts

Joined
Sun Aug 17, 2014 2:43 pm
Location - Venezuela

Post by Exel » Sat Feb 27, 2021 4:03 am

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.

Newbie

Posts

Joined
Sat Feb 13, 2021 5:16 pm

Post by gjburg » Tue Mar 02, 2021 3:31 pm

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

Code: Select all

define('DIR_STORAGE','/var/www/vhosts/domainname.com/storage/');
Thank you!

Newbie

Posts

Joined
Wed Jan 21, 2015 5:02 am

Post by esprit1st » Tue Apr 06, 2021 5:13 am

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

Newbie

Posts

Joined
Sun Feb 17, 2013 6:57 am

Post by ADD Creative » Tue Apr 06, 2021 5:19 am

esprit1st wrote:
Tue Apr 06, 2021 5:13 am
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
Check your OpenCart and PHP error logs.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by esprit1st » Tue Apr 06, 2021 5:52 am

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

Newbie

Posts

Joined
Sun Feb 17, 2013 6:57 am

Post by ADD Creative » Tue Apr 06, 2021 6:02 am

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.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by esprit1st » Tue Apr 06, 2021 6:22 am

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!!

Newbie

Posts

Joined
Sun Feb 17, 2013 6:57 am

Post by jessicana » Tue Jul 27, 2021 4:06 am

Ok, I am using the most recent version of opencart, which is 3.0.3.7. My question: Will I need to remove the

Code: Select all

NO_ZERO_DATE
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?

Newbie

Posts

Joined
Mon Jul 26, 2021 3:14 am

Post by ADD Creative » Tue Jul 27, 2021 5:02 am

It's been remove from the code base. Any new versions should have the change included.
https://github.com/opencart/opencart/co ... 76e934b75e

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by jessicana » Tue Jul 27, 2021 7:38 am

Good to know. Thanks!

Newbie

Posts

Joined
Mon Jul 26, 2021 3:14 am
Who is online

Users browsing this forum: No registered users and 42 guests