Home › Forums › Ticket Products › Event Tickets Plus › Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(
- This topic has 20 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
June 24, 2013 at 9:40 am #52051
djio
ParticipantI’ve got this message after installing WooTickets.
It seems to be a date format issue.
Any help, please?Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() [datetime.--construct]:
Failed to parse time string (1 de January de 1970 0:00) at position 0 (1):
Unexpected character' in /path-to-client/wp-content/plugins/wootickets/views/tickets.php:39Stack trace:
#0 /path-to-client/wp-content/plugins/wootickets/views/tickets.php(39): DateTime->__construct('1 de January de...')
#1 /path-to-client/wp-content/plugins/wootickets/classes/class-wootickets.php(320): include('/path-to-client/...')
#2 /path-to-client/wp-includes/plugin.php(173): TribeWooTickets->front_end_tickets_form(false)
#3 /path-to-client/wp-content/plugins/the-events-calendar/public/template-tags/general.php(302): apply_filters()
#4 /path-to-client/wp-content/plugins/the-events-calendar/views/single.php(100): tribe_get_ticket_form()
#5 /path-to-client/wp-content/plugins/wootickets/views/tickets.php on line 39June 24, 2013 at 10:01 am #52053Barry
MemberHi Dijo,
My guess is that PHP has not been configured to support your locale (Brazil/Portugese?) and so when it tries to convert 1 de January de 1970 it isn’t functioning as expected as, to quote the manual, DateTime functions are dependent on the locale settings of your server.
You can find information on changing this in the PHP manual (but please seek assistance from your web host if you are unsure).
Thanks!
June 24, 2013 at 12:11 pm #52086djio
ParticipantHi Barry, Thanks for the prompt response.
After your reply I tried to set this line in wp-config.php, as instructed in PHP manual and comments (with no change in my site’s behavior whatsoever, so I removed):
setlocale(LC_ALL, "pt_BR", "pt_BR.utf-8", "pt_BR.iso-8859-1", "portuguese");
Even in my WPMU setup, It turns out that my settings were set right for Brazilian Portuguese, Timezone: Americas/Sao_Paulo.
My time settings in this on this specific subsite were “j \d\e F \d\e Y” and the dates were showing up perfectly in the frontend.
I changed the settings to “d/m/Y” and the error was gone, but the tickets info/buttons only appeared when I set them to “m/d/Y”. But unfortunately that will make a mess with all the rest of my dates in the site. So… any thoughts on how to fix this?June 24, 2013 at 12:23 pm #52091Barry
MemberI’m going to pull in our expert in this arena, bear with me 🙂
June 27, 2013 at 8:56 am #52373Barry
MemberHi djio,
Thanks for your patience! What the team recommends is that you change the following line (line 29 in wootickets/views/tickets.php) from:
$event_end_date = tribe_get_end_date();
To:
$event_end_date = tribe_get_end_date( null, false, TribeDateUtils::DBDATETIMEFORMAT );
Does that help at all?
June 27, 2013 at 9:03 pm #52422djio
ParticipantHey!!
Now it’s working perfectly. Thanks a lot!!!
Please add this fix to the next version.
=)June 28, 2013 at 5:57 am #52431Barry
MemberExcellent, glad to hear it’s working well.
I’ll pass your remarks about adding it to the next version back to the developers (thank you for testing this) and hopefully we’ll be all good in subsequent releases.
However… we are actually so close to releasing 3.0 that it may not be possible to put the code in there as there is currently a code freeze in place – so just be aware of that.
Since I think we’re all good otherwise I will go ahead and close this thread.
July 3, 2013 at 2:05 pm #53052Barry
MemberHi Djio, reopened at your request! Can you confirm if the problem is the same / if there is anything else we need to know here?
July 3, 2013 at 2:19 pm #53057djio
ParticipantSame problem… only works when date is set to m/d/Y in General WordPress Settings.
I updated to v3 and changed the files again. fact is It was not working anymore before the update. My suspect is that I’d probably saw a cached page that time. I Already turned off my cache system. Any other options I ca try?
Site in question: http://www.mpc.org.br/evento/treinamento-2014/July 4, 2013 at 6:35 am #53196Barry
MemberLet me take this back to our developers and see what they can offer here.
July 5, 2013 at 11:18 am #53487djio
ParticipantI forgot to mention but wp and all plugins are at latest version. as of today:
WP 3.5.2
WooCommerce 2.0.12
The Events Calendar 3.0
WooTickets 3.0
And I also changed PHP in the server to v5.3 (was v5.2) but nothing changes.So the scenarios I get so far are:
1. Default date format for WP in pt_BR is: j \d\e F \d\e Y – This breaks the layout displaying the Fatal Error message;
2. When I change the date format to m/d/Y everything works fine, but all my sitewide dates appear in a format too strange for us, non-americans;
3. Alternativelly, we could use d/m/Y and in this case, no Fatal Error, but no Tickets also. And besides that, the page shows the final date of my event as TODAY, even is my event is six months from now.Any clues?
July 5, 2013 at 1:00 pm #53519Barry
MemberThe fatal error is obviously problematic and as a fellow non-American I realize that m/d/Y isn’t always ideal 😉 however, because this is a holiday weekend and lots of our team are based in the US there might be a delay while we wait for one of the developers to get back to us.
If you’re able to work around the delay somehow until we get back to normal operations (on Monday) we can hopefully get you a more solid solution.
Thanks again for your patience!
July 5, 2013 at 1:25 pm #53528djio
ParticipantNo prob!
The system is fully working despite the strange date format. On monday we talk again!
Thanks a lot for your time and support.July 5, 2013 at 1:51 pm #53534Barry
MemberThank you for your patience and continued support – have a great weekend and we’ll be in touch Monday. Don’t hesitate to bump the thread if you find yourself waiting on that day.
July 9, 2013 at 7:40 am #54000Barry
MemberHi again, apologies for not getting back to you yesterday.
I’m still waiting on feedback from the developers on this one: the release of 3.0 has caused something of a surge in demand so that is, regrettably, making it harder to deliver support as normal – but bear with us and we’ll update you as quickly as we can.
-
AuthorPosts
- The topic ‘Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(’ is closed to new replies.
