Support

Home Forums Event Espresso Premium Fatal error EE4 with PHP 7.1

Fatal error EE4 with PHP 7.1

Posted: May 17, 2018 at 8:20 am


greyowl

May 17, 2018 at 8:20 am

My hosting provider is upgrading to PHP 7.1 and EE doesn’t seem to be compatible. I get the following error:

Fatal error: Uncaught Error: [] operator not supported for strings in /home/lernenim/public_html/wp-content/uploads/espresso/templates/espresso-events-table-template-toggle.template.php:88 Stack trace: #0 /home/lernenim/public_html/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Template.helper.php(384): include() #1 /home/lernenim/public_html/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Template.helper.php(296): EEH_Template::display_template(‘/home/lernenim/…’, Array, true) #2 /home/lernenim/public_html/wp-content/plugins/eea-events-table-view-template/EES_Espresso_Events_Table_Template.shortcode.php(253): EEH_Template::locate_template(Array, Array) #3 /home/lernenim/public_html/wp-includes/shortcodes.php(319): EES_Espresso_Events_Table_Template->process_shortcode(Array, ”, ‘ESPRESSO_EVENTS…’) #4 [internal function]: do_shortcode_tag(Array) #5 /home/lernenim/public_html/wp-includes/shortcodes.php(197): preg_replace_callback(‘/\\[(\\[?)(ESPRES…’, ‘do_shortcode_ta…’, ‘<p> </p>\n<.. in /home/lernenim/public_html/wp-content/uploads/espresso/templates/espresso-events-table-template-toggle.template.php on line 88

What can I do to solve that?


Tony

  • Support Staff

May 17, 2018 at 8:25 am

Hi there,

Its from the custom espresso-events-table-template-toggle.template.php you have in wp-content/uploads/espresso/templates/

On line 88 you likely have $category_slugs = '';

If so, change that to $category_slugs = array();

We had the same report from another user using that same custom template so I’m assuming it’s the same problem as it’s the same error, if not we’ll need to see the contents of that template file.


Josh

  • Support Staff

May 17, 2018 at 8:27 am

Hi greyowl,

That’s not actually Event Espresso throwing the fatal error, it’s your custom template in
wp-content/uploads/espresso/templates/espresso-events-table-template-toggle.template.php on line 88.

You probably have an array initialized as a string somewhere in the file and that can be easily changed to be initialized as an array.

e.g. change this:

$array_of_items = '';

to this:

$array_of_items = array();


greyowl

May 17, 2018 at 2:45 pm

Thanks. That’s fixed it.

The support post ‘Fatal error EE4 with PHP 7.1’ 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