{"id":1388419,"date":"2017-11-21T11:32:58","date_gmt":"2017-11-21T19:32:58","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/"},"modified":"2017-11-21T11:32:58","modified_gmt":"2017-11-21T19:32:58","slug":"recurring-event-cron-task-spawning-php-warning-daily","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/","title":{"rendered":"Recurring Event Cron task spawning PHP Warning daily"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I&#8217;ve been seeing the following warning daily in my logs;<\/p>\n<blockquote><p>[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<\/p><\/blockquote>\n<p>Delving into the code this line throws the warning;<br \/>\n<code>$excluded = array_map( 'strtotime', self::get_excluded_dates( $event_id ) );<\/code><\/p>\n<p>Looking at the get_excluded_dates function it appears that the array_map is being executed on the recurrence meta&#8217;s exclusions portion. As the get_excluded_dates calls getRecurrenceMeta and returns $meta[&#8216;exclusions&#8217;] if it&#8217;s not empty.<\/p>\n<p>The problem is that the array_map calling strtotime is expecting an array of strings but instead gets an array of dictionaries. <\/p>\n<p>Diving into my database I only have one Recurring event that has exclusions and it&#8217;s exclusions array contains a single dictionary;<br \/>\n&#8220;exclusions&#8221;: [{<br \/>\n\t&#8220;type&#8221;: &#8220;Custom&#8221;,<br \/>\n\t&#8220;custom&#8221;: {<br \/>\n\t\t&#8220;interval&#8221;: &#8220;1&#8221;,<br \/>\n\t\t&#8220;week&#8221;: {<br \/>\n\t\t\t&#8220;day&#8221;: [&#8220;7&#8221;, &#8220;6&#8221;]<br \/>\n\t\t},<br \/>\n\t\t&#8220;same-time&#8221;: &#8220;yes&#8221;,<br \/>\n\t\t&#8220;type&#8221;: &#8220;Weekly&#8221;<br \/>\n\t},<br \/>\n\t&#8220;end-type&#8221;: &#8220;Never&#8221;,<br \/>\n\t&#8220;EventStartDate&#8221;: &#8220;2017-10-02 09:15:00&#8221;,<br \/>\n\t&#8220;EventEndDate&#8221;: &#8220;2017-10-02 10:00:00&#8221;<br \/>\n}],<br \/>\nBut the code expects a string.<\/p>\n<p>I took a screenshot of the Exclusions on the event editor;<\/p>\n<blockquote class=\"imgur-embed-pub\" lang=\"en\" data-id=\"M0wgNLA\"><p><a href=\"https:\/\/imgur.com\/M0wgNLA\">View post on imgur.com<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/s.imgur.com\/min\/embed.js\" charset=\"utf-8\"><\/script><\/p>\n<p>As can be seen it&#8217;s a multi-day exclusion.<\/p>\n<p>Any assistance in rectifying this issue is appreciated.<br \/>\nCheers<\/p>\n","protected":false},"template":"","class_list":["post-1388419","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Recurring Event Cron task spawning PHP Warning daily -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recurring Event Cron task spawning PHP Warning daily -\" \/>\n<meta property=\"og:description\" content=\"Hello, I&#8217;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( &#039;strtotime&#039;, self::get_excluded_dates( $event_id ) ); Looking at the get_excluded_dates function it appears that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/\",\"name\":\"Recurring Event Cron task spawning PHP Warning daily -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-11-21T19:32:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Recurring Event Cron task spawning PHP Warning daily\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Recurring Event Cron task spawning PHP Warning daily -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/","og_locale":"en_US","og_type":"article","og_title":"Recurring Event Cron task spawning PHP Warning daily -","og_description":"Hello, I&#8217;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 [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/","name":"Recurring Event Cron task spawning PHP Warning daily -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-11-21T19:32:58+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-event-cron-task-spawning-php-warning-daily\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Recurring Event Cron task spawning PHP Warning daily"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1388419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1388419\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1388419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}