{"id":1221887,"date":"2017-01-21T08:27:31","date_gmt":"2017-01-21T16:27:31","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/"},"modified":"2017-01-23T18:52:19","modified_gmt":"2017-01-24T02:52:19","slug":"view-orders-list-breaks-when-ticket-deleted","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/","title":{"rendered":"View Orders list breaks when ticket deleted"},"content":{"rendered":"<p>Admin view Orders for an event breaks when a ticket is manually deleted, but the matching Attendee is not manually deleted.  Error on Line 389 in table.php.  Looks like you are using the attendee list as the driver for the foreach loop that is looking for the matching orders.  Might be a simple fix to wrap a statement around that to skip to next one if there is no matching Order for the Attendee.  Once we manually delete the orphan attendee, then the Order list comes up fine.  We are using version 4.3.5 of Event Tickets Plus.<\/p>\n<p>This is the code in question, the last code line is number 389 in the table.php file in our version:<\/p>\n<p>foreach ( $query-&gt;posts as &amp;$item ) {<br \/>\n\t\t\t$order_id = get_post_meta( $item-&gt;ID, Tribe__Tickets_Plus__Commerce__WooCommerce__Main::ATTENDEE_ORDER_KEY, true );<\/p>\n<p>\t\t\tif ( isset( $orders[ $order_id ] ) ) {<br \/>\n\t\t\t\tcontinue;<br \/>\n\t\t\t}<\/p>\n<p>\t\t\t$order = WC()-&gt;api-&gt;WC_API_Orders-&gt;get_order( $order_id );<br \/>\n\t\t<strong>\t$orders[ $order_id ] = $order[&#8216;order&#8217;];<\/strong><br \/>\n\t\t}<\/p>\n","protected":false},"template":"","class_list":["post-1221887","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>View Orders list breaks when ticket deleted -<\/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\/view-orders-list-breaks-when-ticket-deleted\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"View Orders list breaks when ticket deleted -\" \/>\n<meta property=\"og:description\" content=\"Admin view Orders for an event breaks when a ticket is manually deleted, but the matching Attendee is not manually deleted. Error on Line 389 in table.php. Looks like you are using the attendee list as the driver for the foreach loop that is looking for the matching orders. Might be a simple fix to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-24T02:52:19+00:00\" \/>\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\/view-orders-list-breaks-when-ticket-deleted\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/\",\"name\":\"View Orders list breaks when ticket deleted -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-01-21T16:27:31+00:00\",\"dateModified\":\"2017-01-24T02:52:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/#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\":\"View Orders list breaks when ticket deleted\"}]},{\"@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":"View Orders list breaks when ticket deleted -","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\/view-orders-list-breaks-when-ticket-deleted\/","og_locale":"en_US","og_type":"article","og_title":"View Orders list breaks when ticket deleted -","og_description":"Admin view Orders for an event breaks when a ticket is manually deleted, but the matching Attendee is not manually deleted. Error on Line 389 in table.php. Looks like you are using the attendee list as the driver for the foreach loop that is looking for the matching orders. Might be a simple fix to [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/","article_modified_time":"2017-01-24T02:52:19+00:00","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\/view-orders-list-breaks-when-ticket-deleted\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/","name":"View Orders list breaks when ticket deleted -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-01-21T16:27:31+00:00","dateModified":"2017-01-24T02:52:19+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/view-orders-list-breaks-when-ticket-deleted\/#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":"View Orders list breaks when ticket deleted"}]},{"@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\/1221887","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1221887\/revisions"}],"predecessor-version":[{"id":1222697,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1221887\/revisions\/1222697"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1221887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}