{"id":43542,"date":"2013-03-20T22:42:47","date_gmt":"2013-03-21T05:42:47","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/"},"modified":"2013-03-20T22:42:47","modified_gmt":"2013-03-21T05:42:47","slug":"php-warning-tribe-events-recurrence-meta-class-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/","title":{"rendered":"PHP Warning tribe-Events-recurrence-meta.class.php"},"content":{"rendered":"<p>Hi,<\/p>\n<p>In a situation I&#8217;ll describe below, I&#8217;m getting the following PHP warning: &#8220;Warning: Creating default object from empty value in wp-content\\plugins\\Events-calendar-pro\\lib\\tribe-Events-recurrence-meta.class.php on line 46&#8221;. This is only an annoyance, since it doesn&#8217;t appear unless PHP display_errors is set to &#8220;on&#8221;. However, I THINK it represents a minor bug in Events Pro.<\/p>\n<p>Line 46 is part of function admin_bar_render. The statement says:<\/p>\n<p>$edit_link-&gt;href = $edit_link-&gt;href . &#8216;&amp;EventDate=&#8217; . TribeDateUtils::dateOnly($post-&gt;EventStartDate);<\/p>\n<p>I believe this is intended to make sure that, when a user decides to edit a recurring Event, the Edit link takes him\/her to an edit screen for desired Event date (rather than the first occurrence of the recurring Event).<\/p>\n<p>I think the assumption behind this is that the code only gets called when the user is viewing a single instance of the recurring Event.<\/p>\n<p>However, if the recurring Event is the last Event appearing in a listing of multiple Events, admin_bar_render gets called and sets $edit_link to null. Line 46 then attempts to execute, resulting in the PHP warning.<\/p>\n<p>This quick-fix resolved the warning for me:<\/p>\n<p>\tif ($edit_link) {$edit_link-&gt;href = &#8230;}<\/p>\n<p>However, I suspect it would be better if the original condition in admin_bar_render was expanded to make sure it covers the multiple event listing situation I described. Or maybe there&#8217;s more to the story.<\/p>\n<p>Let me know what you think and\/or if you have any questions. Thanks!<\/p>\n","protected":false},"template":"","class_list":["post-43542","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>PHP Warning tribe-Events-recurrence-meta.class.php -<\/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\/php-warning-tribe-events-recurrence-meta-class-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Warning tribe-Events-recurrence-meta.class.php -\" \/>\n<meta property=\"og:description\" content=\"Hi, In a situation I&#8217;ll describe below, I&#8217;m getting the following PHP warning: &#8220;Warning: Creating default object from empty value in wp-contentpluginsEvents-calendar-prolibtribe-Events-recurrence-meta.class.php on line 46&#8221;. This is only an annoyance, since it doesn&#8217;t appear unless PHP display_errors is set to &#8220;on&#8221;. However, I THINK it represents a minor bug in Events Pro. Line 46 is [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/\" \/>\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\/php-warning-tribe-events-recurrence-meta-class-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/\",\"name\":\"PHP Warning tribe-Events-recurrence-meta.class.php -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-03-21T05:42:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/#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\":\"PHP Warning tribe-Events-recurrence-meta.class.php\"}]},{\"@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":"PHP Warning tribe-Events-recurrence-meta.class.php -","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\/php-warning-tribe-events-recurrence-meta-class-php\/","og_locale":"en_US","og_type":"article","og_title":"PHP Warning tribe-Events-recurrence-meta.class.php -","og_description":"Hi, In a situation I&#8217;ll describe below, I&#8217;m getting the following PHP warning: &#8220;Warning: Creating default object from empty value in wp-contentpluginsEvents-calendar-prolibtribe-Events-recurrence-meta.class.php on line 46&#8221;. This is only an annoyance, since it doesn&#8217;t appear unless PHP display_errors is set to &#8220;on&#8221;. However, I THINK it represents a minor bug in Events Pro. Line 46 is [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/","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\/php-warning-tribe-events-recurrence-meta-class-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/","name":"PHP Warning tribe-Events-recurrence-meta.class.php -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-03-21T05:42:47+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/php-warning-tribe-events-recurrence-meta-class-php\/#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":"PHP Warning tribe-Events-recurrence-meta.class.php"}]},{"@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\/43542","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\/43542\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=43542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}