Support » Plugin: Event Organiser » Next date for recurring event wrong in widget

Viewing 15 replies - 1 through 15 (of 20 total)
  • Any help with this? This is now happening to several (but not all) of my events. For instance, I have a weekly event that’s supposed to run all year, and it says the next event is not until december!

    Plugin Author Stephen Harris

    (@stephenharris)

    Hi iamarogue,

    Sorry this one slipped my radar. Which event are you referring to – the one you linked to appears to occur every week: March (6, 13, 20, 27) and 3 April. In the upcoming events its listed as 6 March.

    The last event in ‘this weeks events’ is 10 March – which seems about right.

    Hi Stephen,

    I came up with an interim solution. The problem only seems to occur if you select “group occurrences.” So on the front page of my site, I deselected that option, which is why it says “This Week’s Events.”

    The problem is still occurring in a different instance of the widget, visible on this page (http://kingstonnexus.ca/?cat=7) among others, where “group occurrences” is selected.

    Thanks for getting back to me

    Plugin Author Stephen Harris

    (@stephenharris)

    Hi iamarogue,

    Do you have ‘show past events’ enabled in the plug-in settings. When grouping events it uses the earliest date matching the query – if you’re including past events, then it’ll always be the first date.

    However, if you still want to include past events, and group occurrences: rather than displaying the occurrence’s date you can display the next occurrence for the event:

    See: http://wp-event-organiser.com/documentation/editing-the-templates/ and http://wp-event-organiser.com/documentation/function/eo_get_next_occurrence_of/

    Hi Stephen,

    No, I don’t have show past events enabled. I don’t think that’s quite the issue that I’m identifying, however.

    Assume that I have an event that runs every day in April. Since it is currently March, the NEXT event should be April 1. However, my widget is causing it to display that the next event is actually April 30th, the LAST in the series. This only applies to future events.

    In my widget that is visible here: http://kingstonnexus.ca/?cat=7 I have 13 events visible. Of those events, 7 are displaying properly, with their next occurrence within the next week. 1 is displaying properly but has no recurrence. The remaining 5 are all displaying that their final occurrence is the next occurrence.

    The ones that are behaving correctly are:

    The ones that are behaving incorrectly are:

    Plugin Author Stephen Harris

    (@stephenharris)

    Hi iamarogue,

    Sorry, I forgot you had already mentioned that it only affects some of the events.

    The following code will help debug this:

    add_filter( 'posts_request', 'debugging_event_query', 999, 2 );
    function debugging_event_query( $request, $query ){
    	if( $query->get('post_type') == 'event' && current_user_can( 'manage_options' ) ){
    		var_dump($request);
    	}
    	return $request;
    }

    it should only appear for admins and will print the SQL query. I’m interested in the one that appears immediately before the widget.

    Sorry, I’m not great at programming. Where should I put that snippet of code?

    Plugin Author Stephen Harris

    (@stephenharris)

    Somewhere in your functions.php will do.

    If you haven’t already you might want to disable other plug-ins & switch to TwentyTweleve temporarily on the off chance its a plug-in / theme conflict.

    Okay, is this what you wanted?

    string(689) "SELECT SQL_CALC_FOUND_ROWS wp_eo_events.event_id, wp_eo_events.event_id AS occurrence_id, wp_eo_events.StartTime, min(wp_eo_events.StartDate) as StartDate, min(wp_eo_events.EndDate) as EndDate, wp_eo_events.FinishTime, wp_eo_events.event_occurrence, wp_posts.* FROM wp_posts LEFT JOIN wp_eo_events ON wp_posts.id = wp_eo_events.post_id WHERE 1=1 AND wp_posts.post_type = 'event' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND (wp_eo_events.EndDate > '2013-03-13' OR (wp_eo_events.EndDate = '2013-03-13' AND wp_eo_events.FinishTime > '12:55:41')) GROUP BY wp_eo_events.post_id ORDER BY wp_eo_events.StartDate asc, wp_eo_events.StartTime asc LIMIT 0, 15"

    There is no theme/plugin conflict, I checked. I wish it were that easy…

    Plugin Author Stephen Harris

    (@stephenharris)

    I think I know what’s happening here – the group by is not selecting the date with the minimum date – this can happen when the ‘natural’ ordering in the database is not according to the event date.

    The plug-in inserts the dates in date order, but there’s no guarantee that the dates are actually in date order in the database. This doesn’t usually matter since you order the dates in a query – but it matters when grouping because the sort is applied after the grouping.

    The fact that this seems to be affecting only some events supports this.

    I’ll hopefully get time to work on a solution over the weekend, and incorporate a fix into 1.8.

    Well thanks for the help. It’s a great plugin!

    Hi Stephen,

    Any news here?

    I am also having a similar issue. Some, not all, recurring events are being saved on the backend with their initial dates wrong, even though it shows correctly on the event admin page. Some have the initial date saved as the final date, another has some arbitrary date in the middle. I have tried deleting and creating the events again or changing their initial and final dates, but the problem persists.

    This one, for example: http://maurobrucoli.com/wordpress/agenda/a-sagracao-da-primavera-stravinsky/.

    It is in portuguese. It goes from july 4th to july 7th, but it is showing on the sidebar as july 7th, even if its not even july 4th yet.

    I appreciate the help.

    Sadly no news. I’m still having the same issue.

    Plugin Author Stephen Harris

    (@stephenharris)

    I’m afraid this one has me stumped – and I’ve not been able to reproduce it.

    Victor – can you confirm that this only occurs when grouping events – as this seems to be the issue here.

    I have the same from time to time, comes and goes with updates.

    For a series of events, the Events Archive only shows the last event. I have weekly events which show okay in side bar widget, but in the Events list (archive) only the last event date appears, e.g. in December even though it’s only July. Events are all there in calendar view. I have events grouped, but do not display past events. This bug seems to come and go with each update. It was okay until I updated to 2.1.7. As an interim step I am updating ‘once only’ events every week. Deactivating and re-activiating has not worked, deleting event and starting again does not work either. Apart from regular updates causing this problem, this is the best events plugin I have found.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Next date for recurring event wrong in widget’ is closed to new replies.