{"id":1216540,"date":"2017-01-11T08:06:51","date_gmt":"2017-01-11T16:06:51","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/"},"modified":"2017-01-12T05:47:11","modified_gmt":"2017-01-12T13:47:11","slug":"500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/","title":{"rendered":"500 Internal Server Error on admin-ajax.php when editing RSVP ticket"},"content":{"rendered":"<p>My issue is similar to the problem identified in <a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/cant-adjust-stock-problem-with-rsvp\/\">this thread<\/a> but the solution there did not solve the problem.<\/p>\n<p>My client is running Event Tickets Plus with WooCommerce, and also offers some free events with RSVP only. The client reported being unable to edit an existing ticket. Specifically, the issue is with editing a ticket that is <em>only<\/em> RSVP, no paid (WooCommerce) tickets.<\/p>\n<p>I tested and found that clicking Edit causes the ticket postbox to gray out for a few seconds, and then nothing else happens. Console indicates a 500 Internal Server Error on the call to admin-ajax.php.<\/p>\n<p>Turning on WP_DEBUG revealed the following error message:<\/p>\n<p><code>PHP Fatal error:  Call to a member function get_stock_quantity() on a non-object in \/[PATH]\/wp-content\/plugins\/event-tickets-plus\/src\/Tribe\/Commerce\/WooCommerce\/Main.php on line 1222<\/code><\/p>\n<p>That line reads:<\/p>\n<p><code>$actual_stock = wc_get_product( $ticket_id )-&gt;get_stock_quantity();<\/code><\/p>\n<p>My thought here is that since there&#8217;s no WooCommerce ticket, the <code>wc_get_product()<\/code> function is returning false\/null instead of an object; hence the error.<\/p>\n<p>I change the line to the following&#8230;<\/p>\n<p><code>$actual_stock = (wc_get_product( $ticket_id )) ? wc_get_product( $ticket_id )-&gt;get_stock_quantity() : 0;<\/code><\/p>\n<p>&#8230;and confirmed that it appears to resolve the issue.<\/p>\n","protected":false},"template":"","class_list":["post-1216540","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>500 Internal Server Error on admin-ajax.php when editing RSVP ticket -<\/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\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"500 Internal Server Error on admin-ajax.php when editing RSVP ticket -\" \/>\n<meta property=\"og:description\" content=\"My issue is similar to the problem identified in this thread but the solution there did not solve the problem. My client is running Event Tickets Plus with WooCommerce, and also offers some free events with RSVP only. The client reported being unable to edit an existing ticket. Specifically, the issue is with editing a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-12T13:47:11+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\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/\",\"name\":\"500 Internal Server Error on admin-ajax.php when editing RSVP ticket -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-01-11T16:06:51+00:00\",\"dateModified\":\"2017-01-12T13:47:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/#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\":\"500 Internal Server Error on admin-ajax.php when editing RSVP ticket\"}]},{\"@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":"500 Internal Server Error on admin-ajax.php when editing RSVP ticket -","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\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/","og_locale":"en_US","og_type":"article","og_title":"500 Internal Server Error on admin-ajax.php when editing RSVP ticket -","og_description":"My issue is similar to the problem identified in this thread but the solution there did not solve the problem. My client is running Event Tickets Plus with WooCommerce, and also offers some free events with RSVP only. The client reported being unable to edit an existing ticket. Specifically, the issue is with editing a [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/","article_modified_time":"2017-01-12T13:47:11+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\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/","name":"500 Internal Server Error on admin-ajax.php when editing RSVP ticket -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-01-11T16:06:51+00:00","dateModified":"2017-01-12T13:47:11+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/500-internal-server-error-on-admin-ajax-php-when-editing-rsvp-ticket\/#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":"500 Internal Server Error on admin-ajax.php when editing RSVP ticket"}]},{"@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\/1216540","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\/1216540\/revisions"}],"predecessor-version":[{"id":1217315,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1216540\/revisions\/1217315"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1216540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}