AkeebaSubs - entries with wrong time

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 3 months ago #116636

[url of the page with the problem] : http://www.cmdnet.org
[HikaShop version] : 2.1.3
[Joomla version] : 2.5.13
[PHP version] : 5.3.27
[Browser(s) name and version] : Chrome
[Error-message(debug-mod must be tuned on)] : n/a

We're using HikaShop to sell subscriptions in AkeebaSubs.
Everything appears to be working properly; except, when a subscription (new or renewal) is created in AkeebaSubs the subscription time is 5 hours in the future.

I've spent a LOT of time testing with various timezone settings.
Tested with purchasing subscriptions directly through Akeeba and the times are set correctly (new and recurring).

The timezone on the server is manually set via PHP.ini settings (due to other configuration needs via php.ini).

I'm wondering if we need to set that time zone directly within a certain folder for this integration plugin to work.

Any ideas?

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 3 months ago #116641

Update...

I located the akeebasubs plugin (/plugins/hikashop/akeebasubs) and I added a specific php.ini file setting the timezone there specifically (date.timezone = "CST6CDT") and still the subscriptions are getting set with the wrong time - + 5 hours.

I sure hope there is a quick fix to resolve this issue.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #116757

Hi,

Do you have the latest version of the akeebasubs plugin ?
Some changes have been made regarding the date. Actually we are using the Joomla function JDate() to set the date.
So there should not be that problem.

Here is the link:
www.hikashop.com/support/support/documen...a-subscriptions.html

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 3 months ago #116841

We were not on the latest version.

I have now upgraded and we're still having the same problem.

I've also tried everything I can think of, setting the timezone via php.ini in the plugin folder directly, changing the entire site to UTC, setting the timezone to GMT-5 (to account for the added 5 hours), no matter what, the subscription is getting 5 hours added to the start time after the previous/existing subscription's end time.

This is not happening with orders in the cart itself. Those times are working just fine (no matter what I set the timezone to - they match).

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 2 months ago #116861

Also, one other thing I forgot to mention, we are running the site on Incapsula CDN. Not sure if that might be causing the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 2 months ago #117064

I think I might have tracked this down.

The Default Time Zone on our system is UTC.
But the date.timezone setting is CST6CDT.
We do have the Joomla global config to America/Chicago zone.

It looks like somehow your code isn't paying attention to the time zone offset.

[Caution ... rusty PHP coder writing here]

All the akeebasubs entries are saved in the db in UTC format.
But it doesn't appear that your code does anything to handle the local timezone offset.
I've read a little bit about this, including this post:
compojoom.com/about/blog/entry/how-to-use-jdate

The problem offset is happening both with renewals as well as new subscriptions.

The one thing that I can't tell (still trying to track down and test) is where Jdate gets its information from - is it from php's 'Default Time Zone' or the local 'date.timezone'?
Due to some other necessary configurations on this server, they are different (Default=UTC; date.timezone=CST6CDT), which might also explain the offset.

I'm continuing to test, but would really like to get to the bottom of this.

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 2 months ago #117166

This took a lot of digging and testing.

It appears that Joomla itself (JDate) must be pulling the time from the Default timezone and not paying any attention to any time zone set int he date.timezone override. However, something strange seems to be happening with the way that this plugin is handling the renewal subscriptions. It's always doing some 'math' on the renewal subscription - adding or subtracting the difference between the Default timezone on the server and the Joomla TimeZone; however, all the times in Akeeba Subscription tables are supposed to be in UTC.

I wasn't able to track down the problematic code in this plugin, but I did come up with a work-around:
Just make sure that EVERYTHING on your server is set to UTC (Default timezone, date.timezone, Joomla global config time zone) and then this plugin doesn't see any time difference and the renewals are handled almost* properly.

* I say almost because there's a problem with multiple renewals, but I'll post that in another topic.

Hope this helps someone else that runs into this.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #117291

Hi,

This plugin just take the current date from JDate() and do some math with the previously stored timestamp, the subscription duration and a fix value.
So it's working depending on the previous parameters.

Thanks for your help.

I just answered to your other post about akeeba subscriptions renewal.

Please Log in or Create an account to join the conversation.

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
11 years 2 months ago #117745

Also, just for anyone fighting with similar timezone issues between HS and AS ... be aware that AS presently displays all subscriptions in UTC (or the default time zone of the server) no matter how you have Joomla (or the individual user) time zone set.

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum