Old Recurring Event Issue

Home Forums Calendar Products Events Calendar PRO Old Recurring Event Issue

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1365126
    Adam Listek
    Participant

    Hello,

    There are a number of old recurring events that have the following PHP error:

    Warning: explode() expects parameter 2 to be string, array given in /.../wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Meta.php on line 1430

    We can fix them by re-saving on the backend but they are difficult to find and it appears to relate to “rules” in the meta_value for the Event Recurrence (wrote a SQL query to find the several hundred that still appear to have the problem).

    Best I can tell is that there was a change in how the data is saved and at some point a utility method was enabled in the interface to “Import Recurrence Rules” but for the life of me I cannot seem to find it.

    Is this still a possibility or is there another fix that I can apply? Thank you very much for the help!

    -Adam

    #1365867
    Patricia
    Member

    Hey Adam,

    Thank you for reaching out to us!

    I’ve investigated our internal bug reports and an update mechanism was released on June to solve this problem, although it doesn’t seem to be working in your specific case.

    If you open:

    events-calendar-pro/src/Tribe/Recurrence/Meta.php

    Go to line 1430 and modify the code from:

    // Select saves on a single field, and we have to explode it into an array for manipulation
                if ( isset( $rule['custom']['year']['month'] ) ) {                                                                                                                                               
                    $rule['custom']['year']['month'] = array_map( 'intval', explode( ',', $rule['custom']['year']['month'] ) );
                }

    to:

    // Select saves on a single field, and we have to explode it into an array for manipulation
    if ( isset( $rule['custom']['year']['month'] ) ) {
      if ( ! is_array( $rule['custom']['year']['month'] ) ) {
        $rule['custom']['year']['month'] = explode( ',', $rule['custom']['year']['month'] );
      }
      $rule['custom']['year']['month'] = array_map( 'intval', $rule['custom']['year']['month'] );
    }

    Does it help you to solve the problem? This workaround was proposed by one of our customers: you will find more information here.

    I’m not able to reproduce this error in my own WordPress install, so I would suggest you to try this and let me know how it goes.

    Thanks!

    Patricia

    #1366324
    Adam Listek
    Participant

    Thanks Patricia, I’ll try this out later today and let you know how it goes. I appreciate you checking into this!

    -Adam

    #1366679
    Patricia
    Member

    Hi Adam,

    You are welcome! Let me know if you need anything else in the meantime and I’ll be happy to assist 🙂

    Cheers,

    Patricia

    #1366982
    Adam Listek
    Participant

    This worked to remove the issue, but since this is modifying core code, I can’t really keep using this. Is this bug on the list to be fixed in the next few versions and should I use this as a temporary workaround just in the meantime?

    Another way to get rid of it is to turn on WP_DEBUG and then turn off WP_DEBUG_DISPLAY which may be the most viable workaround for the moment.

    Let me know, thanks!

    -Adam

    #1367591
    Patricia
    Member

    Hi Adam,

    Thanks for your confirmation regarding the temporary fix! I’ve just opened a new internal bug report so our development team can take a look.

    I am going to set the status of this ticket to “pending fix”: you will be contacted as soon as a solution is available.

    In the mean time, you can stick with this temporary fix or simply set WP_DEBUG_DISPLAY to false and in conjunction with WP_DEBUG_LOG (so you can review errors later).

    Thanks for your understanding and if you have any other questions, please let me know and I’ll be happy to assist!

    Best Regards,

    Patricia

    #1409071
    Courtney
    Member

    Hey there Adam

    We’ve just released an update that should fix this bug. You can read more about it at http://m.tri.be/19tp. Please update your plugins and let us know if you are still experiencing this or if we can close out this ticket.

    Note: We suggest testing updates on a staging server (https://theeventscalendar.com/knowledgebase/creating-using-wordpress-staging-site/).

    Thanks
    Courtney 🙂

    #1422489
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Old Recurring Event Issue’ is closed to new replies.