Support

Home Forums Event Espresso Premium Error in the table view

Error in the table view

Posted: September 14, 2017 at 3:30 am

Viewing 5 reply threads


Oguzhan Altun

September 14, 2017 at 3:30 am

Hello,

I have the following error in our new website for zurich:
Warning: reset() expects parameter 1 to be array, string given in /home/clients/b35472e8c3092211273da0d4fc4fb950/web/wp-content/uploads/espresso/templates/template.oa.php on line 356

Warning: reset() expects parameter 1 to be array, string given in /home/clients/b35472e8c3092211273da0d4fc4fb950/web/wp-content/uploads/espresso/templates/template.oa.php on line 356

Warning: reset() expects parameter 1 to be array, string given in /home/clients/b35472e8c3092211273da0d4fc4fb950/web/wp-content/uploads/espresso/templates/template.oa.php on line 356

Here is the code in the template template.oa.php:
https://pastebin.com/pN5xSSht

Line 356 is:
$ticket = reset( $tickets );

you can see the error at https://www.zurichphotoclub.com/daten-preise/

Any idea how I can fix this?


Josh

  • Support Staff

September 14, 2017 at 7:49 am

For that particular error you’ll need to get an array instead of getting a string. On line 354 you have this:
$tickets = espresso_event_tickets_available( $post->ID, FALSE, FALSE );

You need to change to something like this:
$tickets = EEH_Event_View::event_tickets_available( $post->ID );

There’s another issue with line 324 where this:
$category_slugs = '';
needs to be changed to this:
$category_slugs = array();


Oguzhan Altun

September 14, 2017 at 8:39 am

This fixed it! Strangely enough, the same old code does not produce any errors on the genevaphotoclub.com events table..


Oguzhan Altun

September 14, 2017 at 8:40 am

Oops hit submit too soon. Do you think I should change the code anyway on genevaphotoclub site?


Josh

  • Support Staff

September 14, 2017 at 8:51 am

Yes if you ever update the PHP version on the other site you’ll see the same errors there.


Oguzhan Altun

September 14, 2017 at 8:55 am

great, fixed that one too. Thank you for a quick and efficient support.

Viewing 5 reply threads

The support post ‘Error in the table view’ 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