WordPress.org

Ready to get started?Download WordPress

Forums

Event Organiser
[resolved] Next date for recurring event wrong in widget (21 posts)

  1. iamarogue
    Member
    Posted 1 year ago #

    The upcoming events widget on my website (http://kingstonnexus.ca/) displays most events correctly, including recurring events. However, one event doesn't display correctly on the widget, even though it correctly shows the next dates on the event page itself (http://kingstonnexus.ca/?event=dd-encounters-against-the-cult-of-chaos). It only shows the LAST date of the recurrence series, even though there are about 5 events before the last one.

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

  2. iamarogue
    Member
    Posted 1 year ago #

    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!

  3. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  4. iamarogue
    Member
    Posted 1 year ago #

    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

  5. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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/

  6. iamarogue
    Member
    Posted 1 year ago #

    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:

  7. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  8. iamarogue
    Member
    Posted 1 year ago #

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

  9. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  10. iamarogue
    Member
    Posted 1 year ago #

    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...

  11. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  12. iamarogue
    Member
    Posted 1 year ago #

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

  13. vitor.goersch
    Member
    Posted 1 year ago #

    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.

  14. iamarogue
    Member
    Posted 1 year ago #

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

  15. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  16. h01473107
    Member
    Posted 1 year ago #

    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.

  17. h01473107
    Member
    Posted 1 year ago #

    Here's an example, "Coffee & Chat" is Friday weekly, and shows correctly in the "Upcoming Events" list but in the Events List, only the last in the series (13th December 2013) is shown.

    http://www.stnicholaskenilworth.org.uk/events/category/events/

  18. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi h01473107 - this thread is related to the event list widget, and specifically the issue is when grouping events.

    Feel free to open a new thread for this, but as far as I can see the site is using a custom template: which function is being used to display the date?

    If you have a staging site are you able to verify if its a conflict with a plug-in? (Though given the nature of the bug, I doubt it would it be).

  19. Stephen Harris
    Member
    Plugin Author

    Posted 11 months ago #

    I hopefully have a patch for this issue, if you're able to test it and let me know if it works, that would be great!

    https://github.com/stephenharris/Event-Organiser/issues/115

    Thanks!

  20. iamarogue
    Member
    Posted 11 months ago #

    Hi Stephen, works great! This is so exciting!

    Visible here: http://kingstonnexus.ca/?cat=7 (not that you can really see anything as it's working the way it's supposed to...)

    Resolved.

  21. Stephen Harris
    Member
    Plugin Author

    Posted 11 months ago #

    Awesome, they'll be an update in the next few days.

    Apologies that this took so long!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic