Support

Home Forums Event Espresso Premium Error in e/jupiter-child/espresso-events-table-template.templat

Error in e/jupiter-child/espresso-events-table-template.templat

Posted: January 31, 2019 at 5:17 am

Viewing 8 reply threads


Porter

January 31, 2019 at 5:17 am

We are getting the follownig error message
Warning: reset() expects parameter 1 to be array, string given in …./wp-content/themes/jupiter-child/espresso-events-table-template.template.php on line 130 Please advise how we can get this resolved. Thanks


Porter

January 31, 2019 at 5:28 am

This reply has been marked as private.


Josh

  • Support Staff

January 31, 2019 at 7:14 am

Hi,

There’s at least one issue with your code there. For example where you have:

$tickets = espresso_event_tickets_available( $post->ID, FALSE, FALSE );

that needs to be changed to:

$tickets = EEH_Event_View::event_tickets_available( $post->ID );

while you’re there fixing things:

if ( ! ($event->is_sold_out() || $event->is_sold_out( TRUE ) ) ) {

could be changed to:

if ( ! $event->is_sold_out() ) {

which should significantly speed up the page load.


Porter

January 31, 2019 at 7:32 am

Thanks for getting back to me so quickly. I’ve made the changes you suggested but am still getting the same error message!


Porter

January 31, 2019 at 7:35 am

We only seemed to get this error once we started adding lots more events


Josh

  • Support Staff

January 31, 2019 at 7:39 am

May I ask did you save the file after making the change? If so, what’s currently on line 127?


Porter

January 31, 2019 at 8:56 am

I’ve resaved the changes and am now getting the following error

application/x-httpd-php espresso-events-table-template.template.php PHP script text

The code from line 127 is as follows:

if ( ! $event->is_sold_out() ) {

// grab array of EE_Ticket objects for event
$tickets = EEH_Event_View::event_tickets_available( $post->ID );

// grab first ticket from array
$ticket = reset( $tickets );
//check if the ticket is free, if set the ticket price to ‘Free’
if ( $ticket instanceof EE_Ticket ) {
$ticket_price = $ticket->pretty_price();
$ticket_price_data_value = $ticket->price();
$ticket_price = $ticket_price_data_value == 0 ? __( ‘Free’, ‘event_espresso’ ) : $ticket_price;
}


Josh

  • Support Staff

January 31, 2019 at 9:03 am

You need to remove that application/x-httpd-php espresso-events-table-template.template.php PHP script text from the top of the file.

The very first thing that should be in the file is
<?php. There should be nothing before that.


Porter

January 31, 2019 at 9:11 am

Thank you – am not sure how that ended up in there. It’s all ok now.

Viewing 8 reply threads

The support post ‘Error in e/jupiter-child/espresso-events-table-template.templat’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso