{"id":1346280,"date":"2017-09-07T15:06:34","date_gmt":"2017-09-07T22:06:34","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/"},"modified":"2017-09-07T15:06:34","modified_gmt":"2017-09-07T22:06:34","slug":"recurring-events-unable-to-empty-trash","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/","title":{"rendered":"Recurring events &#8211; unable to empty trash"},"content":{"rendered":"<p>I have found an issue with regards to emptying the trash containing RECURRING events. In the front-end, you get a white screen. In the back-end, it is throwing an error in the server logs.<\/p>\n<p>PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in&#8230;. \/wp-content\/plugins\/events-calendar-pro\/src\/Tribe\/Recurrence\/Meta.php:420<\/p>\n<p>I have isolated it to PHP version 7.1 (7.1.6). The issue is NOT present in PHP 7.0 (7.0.15).<\/p>\n<p>Adding $recurrence_meta = array(); resolves the issue, as illustrated below.<\/p>\n<p><code><\/p>\n<p>\tpublic static function add_date_exclusion_to_recurrence( $recurrence_meta, $date ) {<br \/>\n\t\tif ( ! isset( $recurrence_meta['exclusions'] ) ) {<br \/>\n\t\t\t$recurrence_meta['exclusions'] = array();<br \/>\n\t\t}<\/p>\n<p>\t\t$recurrence_meta = array();<br \/>\n\t\t$recurrence_meta['exclusions'][] = array(<br \/>\n\t\t\t'type'   =&gt; 'Custom',<br \/>\n\t\t\t'custom' =&gt; array(<br \/>\n\t\t\t\t'type' =&gt; 'Date',<br \/>\n\t\t\t\t'date' =&gt; array(<br \/>\n\t\t\t\t\t'date' =&gt; $date,<br \/>\n\t\t\t\t),<br \/>\n\t\t\t),<br \/>\n\t\t);<\/p>\n<p>\t\treturn $recurrence_meta;<br \/>\n\t}<\/p>\n<p><\/code><\/p>\n<p>As a side note, I am able to reproduce the issue in a clean sandbox.<\/p>\n","protected":false},"template":"","class_list":["post-1346280","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 events - unable to empty trash -<\/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-events-unable-to-empty-trash\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recurring events - unable to empty trash -\" \/>\n<meta property=\"og:description\" content=\"I have found an issue with regards to emptying the trash containing RECURRING events. In the front-end, you get a white screen. In the back-end, it is throwing an error in the server logs. PHP Fatal error: Uncaught Error: Cannot use string offset as an array in&#8230;. \/wp-content\/plugins\/events-calendar-pro\/src\/Tribe\/Recurrence\/Meta.php:420 I have isolated it to PHP version [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/\" \/>\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-events-unable-to-empty-trash\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/\",\"name\":\"Recurring events - unable to empty trash -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-09-07T22:06:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/#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 events &#8211; unable to empty trash\"}]},{\"@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 events - unable to empty trash -","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-events-unable-to-empty-trash\/","og_locale":"en_US","og_type":"article","og_title":"Recurring events - unable to empty trash -","og_description":"I have found an issue with regards to emptying the trash containing RECURRING events. In the front-end, you get a white screen. In the back-end, it is throwing an error in the server logs. PHP Fatal error: Uncaught Error: Cannot use string offset as an array in&#8230;. \/wp-content\/plugins\/events-calendar-pro\/src\/Tribe\/Recurrence\/Meta.php:420 I have isolated it to PHP version [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/","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-events-unable-to-empty-trash\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/","name":"Recurring events - unable to empty trash -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-09-07T22:06:34+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-unable-to-empty-trash\/#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 events &#8211; unable to empty trash"}]},{"@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\/1346280","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\/1346280\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1346280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}