Home › Forums › Ticket Products › Eventbrite Tickets › Error calling tribe_eb_is_live_event & tribe_eb_get_ticket_count
- This topic has 5 replies, 3 voices, and was last updated 9 years, 3 months ago by Leah.
-
AuthorPosts
-
December 9, 2014 at 8:06 am #913034crhallenParticipant
I am trying to call a series of the eventbrite template tags (from https://theeventscalendar.com/support/documentation-eventbrite-tickets/eventbrite-template-tags/) in functions.php as below:
$added = array(
'is_allday' => tribe_get_all_day( $postId ),
'is_multiday' => tribe_is_multiday( $postId ),
'event_start' => tribe_get_start_date( $postId, false, 'M j, g:i A' ),
'event_end' => tribe_get_end_date( $postId, false, 'M j, g:i A' ),
'organiser_name' => tribe_get_organizer( $postId ),
'venue_name' => tribe_get_venue( $postId ),
'eb_id' => tribe_eb_get_id( $postId ),
'eb_show_tickets' => tribe_event_show_tickets( $postId ),
'eb_is_live' => tribe_eb_is_live_event( $postId ),
'eb_ticket_count' => tribe_eb_get_ticket_count( $postId ),
'event_cost' => tribe_get_cost( $postId ),
);
Trying each one individually, most work but I am encountering the following errors:
tribe_eb_get_id( $postId ) returns:
PHP Strict Standards: Non-static method Event_Tickets_PRO::getEventId() should not be called statically in /wp-content/plugins/the-events-calendar-eventbrite-tickets/public/template-tags.php on line 31
PHP Strict Standards: Non-static method Event_Tickets_PRO::getEventId() should not be called statically in /wp-content/plugins/the-events-calendar-eventbrite-tickets/public/template-tags.php on line 31tribe_eb_is_live_event( $postId ) returns:
PHP Strict Standards: Non-static method Event_Tickets_PRO::isLive() should not be called statically in /wp-content/plugins/the-events-calendar-eventbrite-tickets/public/template-tags.php on line 43
PHP Fatal error: Using $this when not in object context in /wp-content/plugins/the-events-calendar-eventbrite-tickets/lib/tribe-eventbrite.class.php on line 1863tribe_eb_get_ticket_count( $postId ) returns:
PHP Strict Standards: Non-static method Event_Tickets_PRO::sendEventBriteRequest() should not be called statically in /wp-content/plugins/the-events-calendar-eventbrite-tickets/public/template-tags.php on line 16
PHP Fatal error: Using $this when not in object context in /wp-content/plugins/the-events-calendar-eventbrite-tickets/lib/tribe-eventbrite.class.php on line 1691While the Strict Standard errors are not of great concern (right?), can you help me solve the Fatal Errors?
Thanks
December 9, 2014 at 11:13 am #913284BrianKeymasterHello,
Thanks for using our plugins. I can try to help out here, in 3.9 we changed the methods in the class that our template tags are using such as this one:
tribe_eb_is_live_event( $postId )
That is causing the fatal errors.
You can use this snippet instead until this is resolved:
https://gist.github.com/jesseeproductions/9f96d2ef2dc8e1c41922
Let me know if you have any follow up questions.
Thanks
*This post was edited to fix issues reported by ibex in this ticket:
December 15, 2014 at 2:43 am #918276crhallenParticipantOK. So I needed to create an object as the methods were not declared as static in the class.
For the first two it is more simple:
//create new object
$eventobj = new Event_Tickets_PRO();
//call the methods within the class
$eb_id = $eventobj->getEventId( $postId ),
$eb_is_live = $eventobj->isLive( $postId ),For the last one, to count the number of eventbrite ticket types:
//use api call to get all eventbrite data
function tribe_eb_all( $postId = null, $eventobj ) {
$postId = TribeEvents::postIdHelper( $postId );
if ( $EventBriteId = get_post_meta( $postId, ‘_EventBriteId’, true ) ) {
$event = $eventobj->sendEventBriteRequest( ‘event_get’, ‘id=’ . $EventBriteId, $postId );
return $event;
} else {
return false;
}
}
//create new object and call the function
$eventobj = new Event_Tickets_PRO();
$event = tribe_eb_all( $postId, $eventobj );
//count the number of ticket types
$eb_no_of_ticket_types => count( $event[‘event’][‘tickets’] );December 15, 2014 at 6:17 am #918428BrianKeymasterGreat, thanks for sharing your coding with everyone.
I know someone will find that useful.
I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.
Thanks
December 18, 2014 at 7:34 am #922494BrianKeymasterThis ticket is closed, but has been added to a bug ticket. This bug was found thanks to the post by ibex here:
The original post was also edited to remove information that was not correct about my original assessment.
Due to a change in the methods in 3.9 the following template tags in EventBrite now return fatal errors of not in object context.
- tribe_eb_get_ticket_count()
- tribe_eb_is_live_event()
- tribe_eb_event_status()
- tribe_eb_event_list_attendees()
crhallen your coding is a way around this bug until we can fix this issue.
We will update this ticket once we have information on a solution.
If you have issues related to this please create a new ticket and we can help you out.
January 15, 2015 at 1:51 pm #933438LeahMemberHi there,
Thanks for your patience while we looked into this problem. We are working on a secondary maintenance release that addresses this issue. Keep an eye on your site for a new update to version 3.9.1. We’ve tested this release thoroughly and it should resolve the reported issue. However, if you are still running into trouble please start a new thread and we will respond as soon as possible. Thanks again for your patience and support!
Best,
Leah
and the team at Modern Tribe -
AuthorPosts
- The topic ‘Error calling tribe_eb_is_live_event & tribe_eb_get_ticket_count’ is closed to new replies.