WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: The Events Calendar] Conflict between Gridview and Events List Manager (3 posts)

  1. websherpa
    Member
    Posted 4 years ago #

    I have implemented this fix: $this->date = substr_replace( $date, '01', -2 ); and it fixes the problem where events are missing in the grid view if called by URL /events/months and there are corresponding digits in the day and month or year.

    However I am still having a conflict (at least in my installation) with the sidebar Events List Widget.

    When I turn the widget on, it appears in the sidebar and lists events correctly, BUT it breaks the gridview (in all cases) such that it no longer shows events (on any date) and the calendar it shows is not correct for the month. The List view works correctly.

    No events appear in the calendar, AND the calendar for any month selected starts with Day 1 on Monday at the top left and goes for 31 days. No matter which month is selected via drop down or url. i.e. February 2010 starts Monday 1 and shows 31 days.

    The example is here: http://develop.posseproject.ca/index.php/category/events/?$

    But in all likelihood, I will have the "upcoming events" sidebar widget turned off until I get a fix. (So the calendar will otherwise appear to be working).

    If you have any suggestions as to what I should look for in the code to determine why the conflict is occuring, or how to change the Sidebar Widget so that it doesn't break the loop generating the calendar - would be much appreciated!

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

  2. websherpa
    Member
    Posted 4 years ago #

    OK, what I've discovered is that I believe the Widget handling function within the-events-calendar.php isn't cleanly handing over the global $wp_query;

    in line 1240, if I comment out
    //$wp_query->set( 'eventDisplay', 'bydate' );

    [don't try this at home folks]

    The sidebar Widget no longer conflicts with the gridview event calendar. IT may be however that 'eventDisplay' is just coincidentally already set by my previous visits to the page.

    There is a Widget function that "remembers" how $wp_query was set and then attempts to put it back at the end of the Widget function. In my next test I will disable that operation, uncomment line 1240 above and just independently call $wp_query->set( 'eventDisplay', 'upcoming' ); in the Widget function rather than try to do any "memory and reset". In my mind, that arguement is set upon making the call and defines the call, so why does it need to be reset?

    I will report on the result here.

  3. websherpa
    Member
    Posted 4 years ago #

    @justinendler

    OK, I don't have much time to experiment today, but my finding is that eliminating the line 1240 in the-events-calendar.php ->

    //$wp_query->set( 'eventDisplay', 'bydate' );

    Works for me (allows widget to work with full gridview calendar), but

    commenting out line 2007

    $old_display = $wp_query->get('eventDisplay');
    and line 2030

    $wp_query->set('eventDisplay', $old_display);

    instead of commenting out line 1240 does NOT work for me.

    I don't know why this works, but if I had to guess, I would have said that perhaps the establishment of the widget first on the page bypasses the need for the query to occur for the gridview calendar. However this still works for me even when I eliminate the Widget from the sidebar. ??

    Wayne

Topic Closed

This topic has been closed to new replies.

About this Topic