Home › Forums › Calendar Products › Events Calendar PRO › Recurring Event Cron task spawning PHP Warning daily
- This topic has 8 replies, 3 voices, and was last updated 8 years, 4 months ago by
Eclipse Creative.
-
AuthorPosts
-
November 21, 2017 at 11:32 am #1388419
Eclipse Creative
ParticipantHello,
I’ve been seeing the following warning daily in my logs;
[20-Nov-2017 21:14:43 UTC] PHP Warning: strtotime() expects parameter 1 to be string, array given in /wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence/Meta.php on line 1034
Delving into the code this line throws the warning;
$excluded = array_map( 'strtotime', self::get_excluded_dates( $event_id ) );Looking at the get_excluded_dates function it appears that the array_map is being executed on the recurrence meta’s exclusions portion. As the get_excluded_dates calls getRecurrenceMeta and returns $meta[‘exclusions’] if it’s not empty.
The problem is that the array_map calling strtotime is expecting an array of strings but instead gets an array of dictionaries.
Diving into my database I only have one Recurring event that has exclusions and it’s exclusions array contains a single dictionary;
“exclusions”: [{
“type”: “Custom”,
“custom”: {
“interval”: “1”,
“week”: {
“day”: [“7”, “6”]
},
“same-time”: “yes”,
“type”: “Weekly”
},
“end-type”: “Never”,
“EventStartDate”: “2017-10-02 09:15:00”,
“EventEndDate”: “2017-10-02 10:00:00”
}],
But the code expects a string.I took a screenshot of the Exclusions on the event editor;
As can be seen it’s a multi-day exclusion.
Any assistance in rectifying this issue is appreciated.
CheersNovember 21, 2017 at 11:46 am #1388438Eclipse Creative
ParticipantI tried to find when the exclusions meta went from being a string to an array and as far back as I could go (4.4.5 pro) I found that it’s always been an array of dictionaries.
November 23, 2017 at 7:50 am #1390005Victor
MemberHi There!
Thanks so much for taking your time to report this and for giving so many details of what you’ve found so far.
I have indeed been able to locate a report for this issue, so our developers are already aware of it. I will set this thread’s status to “Pending fix” and link it to the report. I will also make sure to pass your findings along to the developers. We will notify you once a fix is released for this issue.
For the moment, it should not affect any functionality. If you happen to find that anything breaks, please let us know about it.
We appreciate your help and patience while we work on this.
Best,
VictorNovember 23, 2017 at 11:06 am #1390190Eclipse Creative
ParticipantThanks Victor, appreciate the update. Let me know if I can assist further. Cheers
November 24, 2017 at 7:14 am #1390655Victor
MemberSure! Thanks for following up.
We’ll keep you posted.
Cheers!
December 19, 2017 at 12:11 pm #1409064Courtney
MemberHey there
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 4, 2018 at 10:38 am #1418178Eclipse Creative
ParticipantThanks Courtney, I’ve confirmed this is fixed.
January 5, 2018 at 5:04 am #1418714Victor
MemberHey There! Thanks for following up with this to confirm it’s fixed.
I’ll go ahead and close this, but feel free to open a new topic if anything comes up and we’ll be happy to help.
Best,
Victor -
AuthorPosts
- The topic ‘Recurring Event Cron task spawning PHP Warning daily’ is closed to new replies.
