Events Manager
Possible bug? Event doesnt appear in list (16 posts)

  1. impactmartin
    Posted 4 years ago #

    I've been populating my events and everything has been going smoothly until now.

    If I create a recurring event to start on the 9th of October 2011, and repeat every sunday, the first event doesn't appear in the list. The recurrences after the 9th of October do though.

    I've done my best to isolate the problem and it seems to only be recurring events beginning on that that (2011/10/9)

    If I create a singular event on that day it appears in the list.

    If I create a recurring event on the 8th or 10th of October it also appears

    Thanks in advance, apart from this - the plugin has been great so far!


  2. impactmartin
    Posted 4 years ago #

    Worth noting that the event on the 9th is present in the database, but it isn't being pulled out on the admin list

  3. Shonu
    Posted 4 years ago #

    if you are using [events_list] shortcode then be aware of meaning of attribtes
    - recurring
    - recurrence (set to 0? Would explain)
    Details here:

  4. Shonu
    Posted 4 years ago #

    Ah, admin list....hmmm

  5. impactmartin
    Posted 4 years ago #

    Ah sorry, yes in the admin interface.

    Could I ask a favour Shonu - would you be able to create a recurring event, starting on the 9th of October 2011, on your installation and let me know if you have the same problem?

    Just trying to isolate exactly what is wrong, cheers

  6. impactmartin
    Posted 4 years ago #

    I was wrong about it being in the database

    A basic recurring event has 3 entries,

    the first is the 'recurrance'
    then second entry is the first day of the event
    the third entry being the 1st copy of the event

    For some reason, on the 9th of October, the second entry isn't added to the database

    Hope this helps debugging

  7. agelonwl
    Posted 4 years ago #


    Just tested it and it works well! with details

    Recurring: Weekly every 1st week sunday
    Date: Oct. 9, 2011 to Dec. 09, 2011
    Time: 8am to 12pm

    Can you try temporarily to deactivate other plugins to see if its a possible conflict?

  8. impactmartin
    Posted 4 years ago #

    Thanks for the response, unfortunately its not a conflict

    I've narrowed it down a little further, although its proving more complicated than I anticipated

    The above problem happens when I create an event on any sunday.

    I've gone through the em-event class (line 1167-1176) and suspect its an issue with WordPress' "Start of the Week" setting set to monday.


  9. impactmartin
    Posted 4 years ago #

    Notes for the author of this plugin

    My wordpress week is set to start on Monday.

    When a recurring event is made, it loops through the week to find the day the event starts on

    If you start the event on a Sunday, the loop at line 1179 iterates through the week beginning Monday. Which is the week after the event takes place in.

    The loop should start on the previous Monday.

    The problem is also with lines 1171-1175, where the day/week offset is defined

    I'll follow up this post with a fix asap

  10. Shonu
    Posted 4 years ago #

    Strange. On my wife's site I got a recurring event series starting 6 November and I also start Mondays. I do see the 6 November (recurring) in the default Events page listed....admin as well

  11. impactmartin
    Posted 4 years ago #

    Fixed the problem

    The issue is around lines 1171, inside function get_recurrence_days()

    Turns out it was a simple bug..

    The offset to get the timestamp of the start of the week, was calculated, but not referenced

    $start_week_date = $start_date - ( ($event_start_day - $start_of_week) * $aDay );

    needs to be replaced with

    $start_week_date = $start_date - ($offset * $aDay);

    Although this method for finding the week start timestamp works - in future improvements it may be best to use mktime.

    Please note, this issue only appears if your wordpress week start setting is set to Monday.

  12. impactmartin
    Posted 4 years ago #

    @Shonu Really? I have no idea - I can only guess that we're using different versions

    Slighty off topic: there is testing code that has been left in the same function around lines 1232.

  13. agelonwl
    Posted 4 years ago #


    I agree that's really strange! however what's your EM version?

  14. Shonu
    Posted 4 years ago #

    Mine is 4.15 on that system. The other have been updated but not checked recurring events there

  15. impactmartin
    Posted 4 years ago #

    Cheers guys, just checked and I'm also on 4.15

    Guessing this has been fixed in the update, i'll check it out

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    I don't remember fixing anything r.e. recurrences recently, but take into account the starting week on your General settings, because that may affect when the first recurrence is applied.

    as Shonu said, you'll always see a recurrence in the DB on the day you created, because that event is a template for the other recurring events.

    (hope that explains it, more would require a long-winded explanation :))

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic