Home › Forums › Calendar Products › Events Calendar PRO › strtotime error
- This topic has 22 replies, 2 voices, and was last updated 10 years, 5 months ago by
Brian.
-
AuthorPosts
-
September 29, 2015 at 5:41 pm #1009882
terrizsolo
ParticipantI have Events Calendar 3.12.2 and Pro 3.12.1 installed (I don’t see a Pro 3.12.2 version). These updates were installed on 9/26. However I’m still getting the error referenced in this forum post as fixed: https://theeventscalendar.com/support/forums/topic/additional-question-from-a-closed-string/
[29-Sep-2015 05:30:03 UTC] PHP Warning: strtotime() expects parameter 1 to be string, array given in /home/soloentr/public_html/blog/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence_Meta.php on line 1060and also this error:
[29-Sep-2015 05:30:03 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/soloentr/public_html/blog/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence_Meta.php on line 1098noted in my /blog/error_log file.
(I note below that I’ve deactivated plugins and reverted to the old theme, but as I don’t know what prompts the error and I can’t leave my blog up for an extended period without plugins and the proper theme, I can’t test this under these conditions.)
September 30, 2015 at 11:38 am #1010156Brian
MemberHi,
Sorry for the issues. I can help troubleshoot.
I am not see those warnings on my test site. So not sure what is causing them on yours.
The file the error is coming from is the Pro Recurring Events.
Have you created New Recurring Events and had issues with them being created? If so can you post in a private reply the settings you are using for an event.
If no new recurring do you have any others on the site ?
Is there anything on the front end breaking because of these warnings?
Let me know and we can go from here.
Thanks
October 5, 2015 at 10:45 am #1011550terrizsolo
ParticipantHi,
- We have not added any new recurring events recently
- We *have* added non-recurring events without problem
- We have not noticed any issues on the front-end
Thanks!
October 6, 2015 at 7:35 am #1011903Brian
MemberHello,
Ok I am not able to replicate the issue.
As they are warnings it will only show in the error log and not break the site or prevent it from loading a page.
If you can clear the error log and then try creating an event or two and see if an error appears after, it would help narrow this down.
Or do the same process and try updating a couple events especially the recurring events and see if it appears that way. You do not have to change the event just click update in it.
Let me know what you find out.
Thanks
October 6, 2015 at 3:10 pm #1012068terrizsolo
ParticipantHi Brian,
I can do the tests you request.
But, (with the caveat that I am NOT a php expert by any stretch of he imagination – purely self-taught by poking around), isn’t the error right here on line 1060:
$excluded = array_map( 'strtotime', self::get_excluded_dates( $event_id ) );And according to the php reference manual:
int strtotime ( string $time [, int $now = time() ] ) The function expects to be given a string containing an English date formati.e. the strtotime call is expecting an argument?
———-
I don’t have a suggestion about the other error though 🙁
———-Another curiosity. From Sept 27-Oct 6, every day, the strtotime error is being triggered at the same time each day, ie 05:30
[06-Oct-2015 05:30:03 UTC] PHP Warning: strtotime() expects parameter 1 to be string, array given in /home/soloentr/public_html/blog/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence_Meta.php on line 1060except on Oct. 5th it was 05:18.
meaning something is triggering it around the same time each day. Which also means it has nothing to do with creating a new event or editing an existing one.
Also, the error is being logged maybe a dozen or so times with the same time stamp. And that string of a dozen strtotime errors is always followed by the second error (just one), also the same time stamp”
[06-Oct-2015 05:30:03 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/soloentr/public_html/blog/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence_Meta.php on line 1098I can send you the error log if it would be helpful, right now it’s around 50k.
I’ll wait to hear from you, esp. since the tests you are asking for will take me some time…
🙂
October 6, 2015 at 4:29 pm #1012083terrizsolo
ParticipantBTW I updated to TEC 3.12.3 and Pro 3.12.2 yesterday.
October 7, 2015 at 6:19 am #1012219Brian
MemberHi,
Thanks for the information and I do not think the error log will be helpful if the errors are all the same as reported. I think you could empty the log for now so we only see new warnings and errors.
Yep that is where the warnings are occurring, but I am not able to replicate or seen other reports. So it is unclear why it is happening and since it is in the middle of the coding the only fix would be to edit the plugin. Before that happens I would like to know why.
I looked at it again and the function running is the save pending events, which could be running from a cron to update existing recurring events as it is around the same time everyday.
Do you have any long running recurring events? It maybe updating those on the cron and since they were created before 3.12 they might be missing information, which causes these warnings.
Let me know.
Thanks
October 7, 2015 at 9:36 am #1012374terrizsolo
ParticipantAh! I have two repeat/end never events. I’ve just updated their recurrence rules to “daily”.
One interesting note, on the one class there were about 16 exclusions to specific dates in the past. Makes me wonder if those were the issue – they just didn’t translate when the plugin was updated, as you suspect.
The error log has been deleted and I will set a reminder for tomorrow to check it!
Thanks,
Terri ZOctober 7, 2015 at 1:22 pm #1012464Brian
MemberThat could be it.
Let me know about the error log tomorrow and we can go from there.
Thanks
October 15, 2015 at 12:18 pm #1015034terrizsolo
ParticipantHi Brian,
So sorry for the delay in responding – I thought I had replied but I must not have hit submit!
I’m still seeing the error:
[08-Oct-2015 05:30:05 UTC] PHP Warning: strtotime() expects parameter 1 to be string, array given in /home/soloentr/public_html/blog/wp-content/plugins/events-calendar-pro/src/Tribe/Recurrence_Meta.php on line 1060Here’s an interesting twist: For the 8th, there were two error messages in the error log file. Ditto for the 9th. (i.e., a total of 4 messages, 2 dated 08-Oct and 2 dated 09-Oct). On the 10th, four with the 10-Oct date stamp (8 total). On the 11th, six. Each day since then there are two more errors with that date stamp than the previous day.
This sure is a squirrel-y error!
October 16, 2015 at 7:02 am #1015236Brian
MemberHi,
I am still not seeing any other reports of this issue.
So it still sounds like it is an old event that does not like the newer recurrence system.
We did make a bunch of changes in Pro for 3.12.4 in this area. Can you update to that and see if that helps?
The next step really would be to give me a backup of your site database so I can try to recreate the issue.
Thanks
October 16, 2015 at 5:57 pm #1015490terrizsolo
ParticipantHi Brian,
I’ve updated to 3.12.4 as requested. I also went into my two recurring events and removed all of the exclusions that had “auto-created” themselves. And I’ve deleted the error_log so it is starting from scratch again.
I will let you know what happens! And am happy to provide whatever you need 🙂 Hopefully it will also help someone else!
October 18, 2015 at 9:20 pm #1015709terrizsolo
ParticipantI’m getting the error recorded in the log still 🙁
A few observations:
- It seems that each night, another exclusion is added auto-magically to each of our two daily-recurring events. The exclusion is for the previous day.
- Also overnight, on the first night after all previous exclusions were removed manually, two errors are logged. I’m going to guess that it is one for each of our two recurring events.
- On the second night, 2 additional exclusions are added, one to each class (total of 4) and 4 errors are logged. Perhaps that connection can provide some insight.
- At this point, I’d suggest that we could just recreate those two recurring classes.
- Or, if there is the possibility that others may see this later, I’m happy to provide a backup copy of our database. I will warn you that it is large, >6000 posts. Just let me know how I could send it to you.
- I know you are trying to recreate the issue. These two events were originally created in January 2015 under the 3.9.x version. It might be necessary to start with a (daily) recurring event created in that environment. Then upgrade to 3.10 and then 3.11 (not sure if it makes a difference to skip versions.) Just my $0.02, worth what paid for 😉
Hope this helps somehow. Please let me know what you want me to do next!
Peace,
Terri ZOctober 19, 2015 at 7:07 am #1015794Brian
MemberHi,
What are the settings for the recurring events you created?
And if you end one of the recurrences and create a brand new one to start today does that prevent the error?
Otherwise a database can be uploaded to dropbox and you could share the link in a private reply.
Thanks
October 19, 2015 at 1:09 pm #1015952terrizsolo
ParticipantHi Brian,
Here are the settings for one of the events (you can see the three exclusions auto-generated so far):

I edited these to stop the existing recurrence, but add a new one starting today (I set the exclusions to None to get rid of them):

———————-For the second class, I created an entirely new event, and made the old one a draft.
I’ll see what happens. And I’ll provide you the link to the database next…
Peace,
Terri Z -
AuthorPosts
- The topic ‘strtotime error’ is closed to new replies.
