System -> Settings -> Store -> Local -> Time Zone
I set the time zone to America/Detroit (-5:00) and was unable to login. I found several posts which addressed this issue, but the one which worked was changing the session engine from db to file in the system/config/default.php and system/config/catalog.php files.
Perhaps this is telling me I need to set the time zone to match somewhere else, but it would be nice if there was a heads up that this result is a possibility, even a check during the initial pre-install list.
I'm sorry but I feel like my original post is not being read. I literally posted how I got there. I was going through the settings and figured setting the timezone would be a fine thing to do. Once I set it and saved, I was logged out and had no way to get back to normal, short of wiping and starting over. I posted how it was solved and thoughts on preventing others from doing it. Searching shows other people have encountered the issue too. It's been ongoing for several versions at least.
However the part that you are not understanding is there is no place to set the timezone in Opencart to best of our knowledge. If you know better please send a screenshot.
There is also no System -> Settings -> Store -> Local -> Time Zone -
There is System -> Settings -> Store and there is System -> Settings -> Local
This is not a bug, at least not in Opencart, but we do thank you for assisting someone - we are just not sure who.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
The timezone setting wasn't available by default in opencart prior to 3.0.3.7, unless you installed a marketplace extension.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
This is going to be fun
AND @vthompson thank you again - would you mind changing the title to 3.0.3.7 and adding [SOLVED] as that will be of use to many people I suspect ..
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Looks like this is a valid bug, haven't spent enough time on 3.0.3.7 to look into it, but was able to quickly duplicate. Since it potentially deals with sessions, the fix should really be addressed from the core.
You could open an issue request on Opencarts Github.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Edit: Modification has been known to not working; error with string as an array given. Codes removed.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
line : 84
// Sync PHP and DB time zones
$db->query("SET time_zone = '" . $db->escape(date('P')) . "'");
For me it was executing "SET time_zone = '+00:00'" where as i am in +7
Commenting out this line and i am able to edit order's.
Good luck
Which PHP version are you using?sukhbirgs wrote: ↑Wed Feb 10, 2021 6:14 amThere could be another issue for 3.0.3.7, i was getting api error editing admin order's and tracked it down to System->framework.php
line : 84
// Sync PHP and DB time zones
$db->query("SET time_zone = '" . $db->escape(date('P')) . "'");
For me it was executing "SET time_zone = '+00:00'" where as i am in +7
Commenting out this line and i am able to edit order's.
Good luck
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
For example: If you look at the following line https://github.com/opencart/opencart/bl ... rk.php#L15
In framework.php it's set default to UTC, it is probably taking priority over date() in the session DB class before the startup.php timezone override can be called.
If that's the case, then the timezone becomes out of sync and would cause the login issue. This could also explain why it works with file sessions as the OP mentioned ( no query is done with file sessions).
If you encounter this, open an issue ticket on the OC GitHub so it can be looked into as its better addressed from the core.
If you get locked out or cannot login try setting the Timezone back to UTC
In phpmyadmin go to your oc_setting table and under the key column look for config_timezone, set the value back to UTC, clear your browser history and try to login again.
-
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Waiting for an official update.
Thank You.
What solution?alejandroalcala wrote: ↑Sun Feb 28, 2021 12:04 amThe solution below provided by Stream, was sucefully applied in my OpenCart installation 3.0.3.7
Waiting for an official update.
Thank You.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Solution that you provide. Fixed your name, sorry hehehehehe (i am learning about how to post correctly in forums).straightlight wrote: ↑Sun Feb 28, 2021 12:25 amWhat solution?alejandroalcala wrote: ↑Sun Feb 28, 2021 12:04 amThe solution below provided by Stream, was sucefully applied in my OpenCart installation 3.0.3.7
Waiting for an official update.
Thank You.
Now my installation of open cart works fine...
Excellent, thanks for your feedback.alejandroalcala wrote: ↑Sun Feb 28, 2021 1:26 amSolution that you provide. Fixed your name, sorry hehehehehe (i am learning about how to post correctly in forums).straightlight wrote: ↑Sun Feb 28, 2021 12:25 amWhat solution?alejandroalcala wrote: ↑Sun Feb 28, 2021 12:04 amThe solution below provided by Stream, was sucefully applied in my OpenCart installation 3.0.3.7
Waiting for an official update.
Thank You.
Now my installation of open cart works fine...
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Either solution could work in this scenario.ClaudePlouffe wrote: ↑Sun Feb 28, 2021 11:51 pmIt think the problem is in the system/framework.php which is setting timezone to 'date_timezone' even after a 'config_time zone' is set in admin/controller/setting/setting.php
Here's my fix
in system/framework.php replace
date_default_timezone_set($config->get('date_timezone'));
with
if ($config->has('config_timezone')) {
date_default_timezone_set($config->get('config_timezone'));
} else {
date_default_timezone_set($config->get('date_timezone'));
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 135 guests