WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
[resolved] Warning: DateTime::format() [function.DateTime-format]: (8 posts)

  1. nightclaw
    Member
    Posted 1 year ago #

    Hi there,
    thanks for the help in advance!

    I've posted some events and when i hit the category page for the first time the events are showing up just fine.
    When i now visit e.g. click on category or venue or refresh that page the following error appears where the date / time normally should be.
    Warning: DateTime::format() [function.DateTime-format]: The DateTime object has not been correctly initialized by its constructor in /var/www/vhosts/cave-con.de/httpdocs/wp-content/plugins/event-organiser/includes/event-organiser-utility-functions.php on line 35

    visit http://cavecon.de/events/venues/saal for a working example ;)

    http://wordpress.org/extend/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    Have you added/updated any plug-ins in between it working ok, and not? Have you tried disabling other plug-ins just in case? I've never seen anything like this before I'm afraid... :/

  3. nightclaw
    Member
    Posted 1 year ago #

    I am not sure if it ever worked correctly, because i did not use it actively until yesterday.
    Could you tell me how to test if it's my webhosting setup that's causing the trouble? Normally time and date are showing just fine. Are there PHP snippets to test the functions?

  4. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    You can use http://wordpress.org/extend/plugins/health-check/screenshots/ to check the PHP version (plug-in supports only 5.2+ which is the currently the minimum requirement of WordPress too).

    Judging by this https://bugs.php.net/bug.php?id=59045 it seems the problem is caching DateTime objects in PHP 5.2 - do you have any caching plug-ins enabled? Does disabling them solve the issue?

  5. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Another possible test is to edit this line: https://github.com/stephenharris/Event-Organiser/blob/1.7.3/includes/event-organiser-event-functions.php#L682

    So that $occurrences = false; to prevent it from trying to use cached DateTime objects. If this solves the problem let me know and I'll implement a work-around in 1.7.4.

  6. nightclaw
    Member
    Posted 1 year ago #

    Excellent: Your server is running PHP version 5.2.4-2ubuntu5.26 and MySQL
    version 5.0.96 which will be great for WordPress 3.2 onward.

    Yes i use XCache on my Webserver and WP-Super-Cache as Plugin, disabling the plugin didn't help.

    With the work-around $occurrences = false; it now seems to work!

    Let me know i you need additional testing or information for further development. Thanks a lot for the fast help!

  7. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Great! I'll introduce a work-around in 1.7.4- so once it's released feel free to update and check the problem hasn't reoccurred.

    Thanks for your help!

  8. nightclaw
    Member
    Posted 1 year ago #

    Did the update and it works like a charm! great job!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic