WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] bug: infinite loop in month calendar view, proposed patch (3 posts)

  1. erachen
    Member
    Posted 10 months ago #

    Using the-event-calendar version 3.1 with PHP Version 5.3.3-7+squeeze16

    I found that displaying calendar as list works
    i.e.: site/agenda/a-venir/

    but displaying as month make a infinite loop.
    i.e.: site/agenda/mois/

    On our installation the problem occur at:
    site/wp-content/plugins/the-events-calendar/lib/tribe-event-query.class.php
    line 777, in function "dateDiff", the while statement never stop because the date does not increment.

    here is the patch we use to workaround it:
    --- tribe-event-query.class.php.orig 2013-11-04 20:28:42.791890593 +0100
    +++ tribe-event-query.class.php.new 2013-11-04 20:29:01.139597485 +0100
    @@ -770,11 +770,11 @@
    * @return int The number of days between two dates.
    */
    public static function dateDiff( $date1, $date2 ) {
    - $current = $date1;
    + $datecurrent = date_create( $date1 );
    $datetime2 = date_create( $date2 );
    $count = 0;
    - while ( date_create( $current ) < $datetime2 ) {
    - $current = gmdate( "Y-m-d", strtotime( "+1 day", strtotime( $current ) ) );
    + while ( $datecurrent < $datetime2 ) {
    + $datecurrent->modify('+1 day');
    $count++;
    }
    return $count;

    http://wordpress.org/plugins/the-events-calendar/

  2. Barry Hughes
    Member
    Plugin Author

    Posted 10 months ago #

    Hi erachen: we haven't had any other reports that I can think of suggesting infinite loops were occurring. Can you confirm what steps we'd need to follow to replicate this and also confirm it occurs even with only a default theme and no other plugins running?

    Thanks!

  3. Barry Hughes
    Member
    Plugin Author

    Posted 9 months ago #

    It's been a while without an update so I'll mark this as resolved. If you need further help though please feel free to post an update or create a new thread, whichever is appropriate.

    Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic