Post by caleb1 » Sat Apr 03, 2021 1:32 am

sw!tch wrote:
Fri Mar 19, 2021 3:09 am
@Marcomz - You shouldn't have to force the timezone to selected in twig. You might be experiencing some other issue with auto-complete or something.

If you get locked out you can simply set the timezeon back to UTC by running the following query.

Code: Select all

UPDATE `oc_setting` SET `value` = 'UTC' WHERE `key` = 'config_timezone';
Or if you want to use a custom timezone, set the system/config/default.php timezone to match what you selected in store settings config_timezone. https://github.com/opencart/opencart/bl ... lt.php#L14

It's important you clear your browser cache after making these changes.
-
I am having this problem and would like to try the solution in the quote above, but I do not have much programming knowledge, so I would appreciate if someone would be able to elaborate on how to run a query.

Thanks.

Newbie

Posts

Joined
Sat Apr 03, 2021 12:45 am

Post by xxvirusxx » Sat Apr 03, 2021 3:48 pm

If you search on Google: how to run a query in mysql, and then change to Videos you will see how.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by caleb1 » Sat Apr 03, 2021 10:37 pm

xxvirusxx wrote:
Sat Apr 03, 2021 3:48 pm
If you search on Google: how to run a query in mysql, and then change to Videos you will see how.
Thanks for the reply, ended up figuring it out.

Newbie

Posts

Joined
Sat Apr 03, 2021 12:45 am

Post by ADD Creative » Tue Apr 06, 2021 7:42 am

xxvirusxx wrote:
Sat Mar 20, 2021 4:56 pm
You can change from db to file like is in Master Branch.
Master branch is not using file as the session engine.
https://github.com/opencart/opencart/bl ... in.php#L16
https://github.com/opencart/opencart/bl ... og.php#L16

The master branch fixes the issue by loading the settings before starting the session.
https://github.com/opencart/opencart/bl ... hp#L23-L24
https://github.com/opencart/opencart/bl ... hp#L20-L21

Changing to file may enable you to login, but you will still have other issues, such as not being able to edit orders.
https://github.com/opencart/opencart/issues/9492

www.add-creative.co.uk


Expert Member

Posts

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

Post by flywatches » Tue Apr 06, 2021 7:59 am

Do you think OC 3.0.3.8 is coming soon and will fix these little bugs/issues?

Jonathan


New member

Posts

Joined
Fri Oct 19, 2012 11:38 pm
Location - Gilbert, AZ

Post by ADD Creative » Tue Apr 06, 2021 7:00 pm

flywatches wrote:
Tue Apr 06, 2021 7:59 am
Do you think OC 3.0.3.8 is coming soon and will fix these little bugs/issues?
At the moment, no. They have rejected it as an issue. https://github.com/opencart/opencart/is ... -796478555

www.add-creative.co.uk


Expert Member

Posts

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

Post by xxvirusxx » Tue Apr 06, 2021 7:29 pm

ADD Creative wrote:
Tue Apr 06, 2021 7:42 am
Master branch is not using file as the session engine.
It is in default file :)
https://github.com/opencart/opencart/bl ... lt.php#L39

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ADD Creative » Tue Apr 06, 2021 10:27 pm

xxvirusxx wrote:
Tue Apr 06, 2021 7:29 pm
It is in default file :)
https://github.com/opencart/opencart/bl ... lt.php#L39
Which is overwritten by by both and admin and catalog configurations when they are loaded, so is never used. https://github.com/opencart/opencart/bl ... hp#L17-L18

www.add-creative.co.uk


Expert Member

Posts

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

Post by kimbo » Tue Oct 12, 2021 10:54 am

New install of 3.0.3.8 on local host.

Encountered this issue while editing the Store Setttings. Same as the other users: changed the Time Zone from "UTC" to "America/New York"
was bounced out shortly thereafter.
Changed password in database, no joy.

Applied Straightlight's fix and the white screen of horror with:
( ! ) Parse error: syntax error, unexpected end of file in C:\Wamp64\www\........\system\framework.php on line 175
This is line 175:
$response->output();
Anyone?

kimbo
The Chloelina All Natural Soap Co.
chloelina.com


Active Member

Posts

Joined
Thu Aug 29, 2013 10:02 pm

Post by ADD Creative » Tue Oct 12, 2021 4:16 pm

Undo Straightlight's fix. See this post for ways to workaround. viewtopic.php?f=201&t=222369&start=20#p816440

Just unbelievable that this wasn't fixed before 3.0.3.8 was released. https://github.com/opencart/opencart/is ... -796478555

www.add-creative.co.uk


Expert Member

Posts

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

Post by straightlight » Tue Oct 12, 2021 7:55 pm

ADD Creative wrote:
Tue Oct 12, 2021 4:16 pm
Undo Straightlight's fix. See this post for ways to workaround. viewtopic.php?f=201&t=222369&start=20#p816440

Just unbelievable that this wasn't fixed before 3.0.3.8 was released. https://github.com/opencart/opencart/is ... -796478555
Not sure where this timezone setting is located still in the OC v3.0.3.8 in the php.ini file ... the addressed commit was also closed by Daniel on anyhow.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by PeachTree » Wed Dec 08, 2021 11:11 pm

Hello EVERYONE.
I am so glad to have found this!
I only just started with OpenCart (opencart-3.0.3.8 ), installing to my wampserver.
After being locked out and reinstalling several times, and trying many solutions that failed, I went looking for another cart.
I went back to Zen Cart. But after being away for many years, ZC doesn't feel good to me anymore. So I came back to OC and tried once again. After finding this thread, I finally knew it wasn't my fault (because I like to change things).
I went into /system/config/default.php, about line 14 and changed it to:
$_['date_timezone'] = 'America/Denver';
Just as suggested and it worked!
Now, I feel like this OC will work for me. I thank ALL of you, for your sharing possible solutions. Just my opinion... It is amazing to me, that a new release was made, when it still has this burp. It should, at least be added to "troubleshooting" in the docs, until they find a way around it for everyone.
Thanks, so much for the help!

Newbie

Posts

Joined
Sat Dec 04, 2021 4:02 am

Post by straightlight » Thu Dec 09, 2021 3:35 am

PeachTree wrote:
Wed Dec 08, 2021 11:11 pm
Hello EVERYONE.
I am so glad to have found this!
I only just started with OpenCart (opencart-3.0.3.8 ), installing to my wampserver.
After being locked out and reinstalling several times, and trying many solutions that failed, I went looking for another cart.
I went back to Zen Cart. But after being away for many years, ZC doesn't feel good to me anymore. So I came back to OC and tried once again. After finding this thread, I finally knew it wasn't my fault (because I like to change things).
I went into /system/config/default.php, about line 14 and changed it to:
$_['date_timezone'] = 'America/Denver';
Just as suggested and it worked!
Now, I feel like this OC will work for me. I thank ALL of you, for your sharing possible solutions. Just my opinion... It is amazing to me, that a new release was made, when it still has this burp. It should, at least be added to "troubleshooting" in the docs, until they find a way around it for everyone.
Thanks, so much for the help!
Ensure to remodify this option prior to run your store on a production server later on.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by pjdm » Mon Dec 27, 2021 12:01 am

I had fixed this problem back in 3.0.3.x and then updated to 3.0.3.8 and forgot about the date issue. I spent part of last two days trying to find why I was locked out of admin access. I tried resetting the admin password a dozen times and kept getting the login screen again. I thought I had upgraded incorrectly. I had to do:
I went into /system/config/default.php, about line 14 and changed it to:
$_['date_timezone'] = 'America/Denver';
This bug is a serious waste of time for people who get caught by it. Is there a way to modify the install to avoid the problem or is this a very limited issue? thanks.

Newbie

Posts

Joined
Thu Jan 25, 2018 10:38 am

Post by BillT » Wed Feb 09, 2022 2:21 am

Thanks to @switch my problem of not being able to log in to Opencart 3.03.8 after changing the timezone in setting. My login to admin is now solved with fix below suggested by @switch. Please dont do any other mod other than this below. It took me no more than 2 minutes.

Go to PHPmyadmin and click on edit in oc_setting table and then click on edit on the 10th row which says config_timezone and replace it with UTC in capital letters. (mine is default theme. i dont know if theme affects the row number) That solved my login issue to the admin and am back in action.

Newbie

Posts

Joined
Wed Dec 08, 2021 4:59 am

Post by geotnt » Thu Apr 07, 2022 10:47 pm

pjdm wrote:
Mon Dec 27, 2021 12:01 am
I had fixed this problem back in 3.0.3.x and then updated to 3.0.3.8 and forgot about the date issue. I spent part of last two days trying to find why I was locked out of admin access. I tried resetting the admin password a dozen times and kept getting the login screen again. I thought I had upgraded incorrectly. I had to do:
I went into /system/config/default.php, about line 14 and changed it to:
$_['date_timezone'] = 'America/Denver';
This bug is a serious waste of time for people who get caught by it. Is there a way to modify the install to avoid the problem or is this a very limited issue? thanks.
Ridiculous that this hasn't been fixed in over a year and after a new version release.

To make sure I understand this correctly, if I modify the /system/config/default.php file as mentioned above, and set the store settings under store/local/time zone to America/Denver everything should work correctly? And then, for example, if I set a sale in my store, it will end at the time based on America/Denver?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by scannercf » Tue Apr 19, 2022 4:48 am

FYI .. just installed version 3.0.3.8 and had the same issue (logged out after updating timezone).
I changed the session handling to 'file' like the OP mentioned and that solved the problem for the moment.

Is OpenCart being actively updated/developed in 2022? I'm surprised this was't fixed already ...

Newbie

Posts

Joined
Tue Apr 19, 2022 4:42 am

Post by Randyo » Tue Apr 19, 2022 9:01 am

sw!tch wrote:
Wed Feb 10, 2021 7:06 pm
I think the problem lies in framework.php with the date_default_timezone_set($config->get('date_timezone'));

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.
-
Thank you.... this is pretty tough to chase down... funny, only thing I changed on the update was the store timezone and the thing worked for 20 minutes or so and died.. Fooled with it for an hour, reloaded the thing, made sure I followed the "upgrade" instructions (only went up 2 minor builds) and it worked again for around 2o minutes.. CARTDB> OC_settings>config_timezone> (removed current time zone) inserted "UTC"

fixed... thanks again...

Newbie

Posts

Joined
Thu Mar 08, 2018 12:50 am

Post by 440music » Wed Jul 20, 2022 6:51 am

This worked for me
Version 3.0.3.8
Extension: MultiVendor TMC
Extension: Hide Category
Plesk Admin Panel
PHPMyAdmin

I had made the change from UTC to America/Chicago my local time zone and was no longer able to login as administrator.
I logged in to Plesk and opened PHPMyAdmin which allowed me to change oc_settings in column key > row config_timezone from America/Chicago to UTC

I had also cleared cache, cookies and history in the browser which fail to allow me to login until I changed the key config_timezone.
Thanks this worked for me :yahoo:
sw!tch wrote:
Fri Mar 12, 2021 4:29 am
undrwater wrote:
Thu Mar 11, 2021 7:55 am
Do you happen to know the mysql syntaxt for the same? I don't have phpmyadmin at the moment.
As always backup, but below should work.

Code: Select all

UPDATE `oc_setting` SET `value` = 'UTC' WHERE `key` = 'config_timezone';
Another option is to set the system/config/default.php timezone to match what you selected in store settings config_timezone. https://github.com/opencart/opencart/bl ... lt.php#L14

-

Tommy TBones
Owner
440Music Entertainment Co
Chicago, IL
Indie Music Radio


User avatar
New member

Posts

Joined
Wed Jun 24, 2020 8:19 am
Location - Chicago, IL USA

Post by lenvil11 » Mon Sep 26, 2022 12:45 pm

By default, timezone in Opencart 3 is set to UTC.
As a result, the incorrect operation of events related to time: for example, special offers.

It's so simpe to configure the correct timezone: open the file system/config/default.php and specify the desired time zone instead of UTC in the line:
// Date
$_['date_timezone'] = 'UTC';
For example, for Ukraine it will look like this:
// Date
$_['date_timezone'] = 'Europe/Kiev';
Here you can find the list of supported timezones: List of Timezones.

Don't forget to refresh caches after changes.

Newbie

Posts

Joined
Mon Sep 26, 2022 12:44 pm
Who is online

Users browsing this forum: DesignCart and 36 guests