Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2022
    Location
    St-Lambert, Canada
    Posts
    26
    Plugin Contributions
    0

    Default After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    Trying to upgrade from version (1.5.5F + super order) to 1.5.7d, using PHP 7.4.3 MySql 5.5.5
    After installation of the version and after ZC_INSTALL, it works well on the catalog pages but I always have this error when I try to connect to the Admin page.

    [18-Nov-2022 22:36:17 America/New_York] Request URI: /pechesud/bureau/index.php?cmd=login&camefrom=index.php, IP address: 127.0.0.1
    #1 trigger_error() called at [D:\xampp734\htdocs\pechesud\includes\classes\db\mysql\query_factory.php:171]
    #2 queryFactory->show_error() called at [D:\xampp734\htdocs\pechesud\includes\classes\db\mysql\query_factory.php:143]
    #3 queryFactory->set_error() called at [D:\xampp734\htdocs\pechesud\includes\classes\db\mysql\query_factory.php:270]
    #4 queryFactory->Execute() called at [D:\xampp734\htdocs\pechesud\bureau\includes\installers\super_orders\4_0_11.php:1 0]
    #5 include(D:\xampp734\htdocs\pechesud\bureau\includes\installers\super_orders\4_0_ 11.php) called at [D:\xampp734\htdocs\pechesud\bureau\includes\init_includes\init_so_config.php:57]
    #6 require_once(D:\xampp734\htdocs\pechesud\bureau\includes\init_includes\init_so_c onfig.php) called at [D:\xampp734\htdocs\pechesud\includes\autoload_func.php:37]
    #7 require(D:\xampp734\htdocs\pechesud\includes\autoload_func.php) called at [D:\xampp734\htdocs\pechesud\bureau\includes\application_top.php:37]
    #8 require(D:\xampp734\htdocs\pechesud\bureau\includes\application_top.php) called at [D:\xampp734\htdocs\pechesud\bureau\login.php:8]
    #9 require(D:\xampp734\htdocs\pechesud\bureau\login.php) called at [D:\xampp734\htdocs\pechesud\bureau\index.php:11]
    --> PHP Fatal error: 1067:Invalid default value for 'last_modified' :: ALTER TABLE zen_so_payments CHANGE date_posted date_posted DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' ==> (as called by) D:\xampp734\htdocs\pechesud\bureau\includes\installers\super_orders\4_0_11.php on line 10 <== in D:\xampp734\htdocs\pechesud\includes\classes\db\mysql\query_factory.php on line 171.


    I didn't have error during data convertion with ZC_install, I check all the logs. Do I need to fixx something in mySQL configuration ?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    The problem is that when the plugin is attempting to modify the super orders database table, there are issues identified with data stored in the date_modified field. zc_install and core zen Cart do not attempt to modify that table, therefore the issue would not have been discovered that way.

    After making a backup of your database, try the following from admin->tools->install sql patches:
    Code:
    UPDATE so_payments SET date_modified = '0001-01-01 00:00:00' WHERE CAST(date_modified AS CHAR(19)) = '0000-00-00 00:00:00';
    If the above is attempted from within utilities such as phpMyAdmin, be sure to include or address the table prefix as well.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,623
    Plugin Contributions
    123

    Default Re: After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    You can read more about this in the documentation.

    https://docs.zen-cart.com/user/upgra...andardization/
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Nov 2022
    Location
    St-Lambert, Canada
    Posts
    26
    Plugin Contributions
    0

    Default Re: After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    Thanks you for the clues

  5. #5
    Join Date
    Nov 2022
    Location
    St-Lambert, Canada
    Posts
    26
    Plugin Contributions
    0

    Default Re: After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    I tried to ALTER TABLE zen_so_payments in PHPAdmin, but I still have a issue when it's time to ALTER TABLE. Here what I did:

    UPDATE zen_so_payments SET date_posted = '0001-01-01 00:00:00' WHERE CAST(date_posted AS CHAR(19)) = '0000-00-00 00:00:00'; (passed)
    UPDATE zen_so_payments SET last_modified = '0001-01-01 00:00:00' WHERE CAST(last_modified AS CHAR(19)) = '0000-00-00 00:00:00'; (passed)

    ALTER TABLE zen_so_payments MODIFY COLUMN date_posted datetime NOT NULL default '0001-01-01 00:00:00'; (Failled)

    MySQL said: Documentation

    #1067 - Invalid default value for 'last_modified'

    PHPAdmin seems to check if all fields (default value) is ok, I also try manually to change the default value in structure browser and I have the same message.
    Attached Images Attached Images  

  6. #6
    Join Date
    Nov 2022
    Location
    St-Lambert, Canada
    Posts
    26
    Plugin Contributions
    0

    Default Re: After upgrading to 1.5.7d - PHP Fatal error: 1067:Invalid default value

    Finally found the issue, if you are using XAMPP 7.4.3, by default SQL_MODE is set STRICT TRANSACTION TABLES mode. To fix the issue, you need to update my.ini and change sql_mode=''.

    Disabling STRICT_TRANS_TABLES mode

    However to allow the format 0000-00-00 00:00:00you have to disable STRICT_TRANS_TABLES mode in mysql config file or by command

    By command

    SET sql_mode = '';

    or

    SET GLOBAL sql_mode = '';

    Using the keyword GLOBAL requires super previliges and it affects the operations all clients connect from that time on

    if above is not working than go to /etc/mysql/my.cnf (as per ubuntu) and comment out STRICT_TRANS_TABLES

    Also, if you want to permanently set the sql mode at server startup then include SET sql_mode='' in my.cnf on Linux or MacOS. For windows this has to be done in my.ini file.

 

 

Similar Threads

  1. v157 PHP Warnings and Fatal errors after upgrading to PHP 8
    By bigandrew in forum General Questions
    Replies: 9
    Last Post: 29 Jul 2021, 05:31 PM
  2. Replies: 7
    Last Post: 22 Dec 2019, 07:07 PM
  3. Replies: 2
    Last Post: 2 Aug 2011, 03:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR