{"id":1426906,"date":"2018-01-15T13:46:57","date_gmt":"2018-01-15T21:46:57","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/"},"modified":"2018-01-15T13:46:57","modified_gmt":"2018-01-15T21:46:57","slug":"deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/","title":{"rendered":"Deleting ticket for a page generated PHP warning for undefined variable"},"content":{"rendered":"<p>We deleted a ticket type defined on a page. The ticket had attendees and it seemed to have been deleted, but we got the following message (for each attendee) in the debug log:<\/p>\n<p>PHP Notice:  Undefined variable: post_to_delete in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line 467<br \/>\nPHP Notice:  Trying to get property of non-object in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line 467<\/p>\n<p>Checking that line in the source code reveals that there is an unset variable used, $post_to_delete, that causes updating of post meta data to fail for all attendees for the deleted ticket.<\/p>\n<p>When listing the attendees for the page, the ticket name for these attendees shows the ticket number followed by &#8220;(deleted)&#8221;.<\/p>\n<p>Plugins installed: Event Tickets Plus 4.6.2, Event Tickets 4.6.3, Events Calendar 4.6.9, Events Calendar Pro 4.4.21, WooCommerce 3.2.6 and WordPress 4.9.1.<\/p>\n","protected":false},"template":"","class_list":["post-1426906","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>Deleting ticket for a page generated PHP warning for undefined variable -<\/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\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deleting ticket for a page generated PHP warning for undefined variable -\" \/>\n<meta property=\"og:description\" content=\"We deleted a ticket type defined on a page. The ticket had attendees and it seemed to have been deleted, but we got the following message (for each attendee) in the debug log: PHP Notice: Undefined variable: post_to_delete in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line 467 PHP Notice: Trying to get property of non-object in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/\" \/>\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\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/\",\"name\":\"Deleting ticket for a page generated PHP warning for undefined variable -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-01-15T21:46:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/#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\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Deleting ticket for a page generated PHP warning for undefined variable\"}]},{\"@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":"Deleting ticket for a page generated PHP warning for undefined variable -","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\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/","og_locale":"en_US","og_type":"article","og_title":"Deleting ticket for a page generated PHP warning for undefined variable -","og_description":"We deleted a ticket type defined on a page. The ticket had attendees and it seemed to have been deleted, but we got the following message (for each attendee) in the debug log: PHP Notice: Undefined variable: post_to_delete in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line 467 PHP Notice: Trying to get property of non-object in \/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/","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\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/","name":"Deleting ticket for a page generated PHP warning for undefined variable -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-01-15T21:46:57+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/deleting-ticket-for-a-page-generated-php-warning-for-undefined-variable\/#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":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Deleting ticket for a page generated PHP warning for undefined variable"}]},{"@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\/1426906","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\/1426906\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1426906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}