Home › Forums › Calendar Products › Events Calendar PRO › Old Recurring Event Issue
- This topic has 8 replies, 3 voices, and was last updated 8 years, 3 months ago by
Adam Listek.
-
AuthorPosts
-
October 17, 2017 at 10:24 pm #1365126
Adam Listek
ParticipantHello,
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 1430We 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
October 19, 2017 at 5:51 am #1365867Patricia
MemberHey 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
October 20, 2017 at 12:11 am #1366324Adam Listek
ParticipantThanks Patricia, I’ll try this out later today and let you know how it goes. I appreciate you checking into this!
-Adam
October 20, 2017 at 10:10 am #1366679Patricia
MemberHi Adam,
You are welcome! Let me know if you need anything else in the meantime and I’ll be happy to assist 🙂
Cheers,
Patricia
October 20, 2017 at 11:18 pm #1366982Adam Listek
ParticipantThis 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
October 23, 2017 at 9:52 am #1367591Patricia
MemberHi 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
December 19, 2017 at 12:19 pm #1409071Courtney
MemberHey 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 🙂January 10, 2018 at 8:37 am #1422489Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Old Recurring Event Issue’ is closed to new replies.
