Event Organiser FES Fatal Error in PHP 8.0

WordPress Event Management, Calendars & Registration Forums Frontend Submissions Event Organiser FES Fatal Error in PHP 8.0

This topic contains 2 replies, has 2 voices, and was last updated by  Pooka & Co 1 month, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43683

    Hi Stephen –

    When updating sites to PHP 8.0+ we’re seeing that we get Critical Error on any front end pages including the FES shortcode output, and in the block editor where a post has that shortcode:

    PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/vhosts/itc-arts.pooka.dev/httpdocs/wp-content/plugins/event-organiser-fes/includes/functions.php:200
    

    Are you planning to bring the extension up to date for PHP 8.0+?

    Best for now
    Marcus

    Pooka & Co
    #43695

    Hi Marcus,

    This isn’t a PHP 8 incompatibility as such. The exception is being thrown because the plugin is attempting to set a property of the ‘form’ object/array, however, for some reason in your case its a string not an object.

    The value being manipulated is retrieved from the post meta table with key ‘_event_form’ and post ID corresponding to the ID set in the shortcode attribute. If you run the following query (replacing X with the form ID) you should see a serialised array

    SELECT meta_value FROM wp_postmeta WHERE meta_key="_event_form" AND post_id=X; 
    

    If it is in deed a string then something has corrupted it. If it isn’t, then I wonder if something could be accidentally modifying the value via a filter. In either case, though, I would also expect the form to not render correctly in the form builder.

    I’ll improve the error handling to prevent the fatal error, but it won’t fix the underlying problem.

    Stephen Harris
    #43696

    Hi Stephen – Thanks for the super speedy reply.

    Yes, that sounds right. I had originally added the FES shortcode in the Gutenberg editor on WP on PHP 8.0 when I saw the Critical Error (on a fresh install of WP/EC/EC FEC with a few other plugins). Switching back to PHP 7.4 resolved the error, so I assumed it was a PHP version error. But then, I was able to switch back to PHP 8.0 and even 8.1 and it remained working. So, not sure what was getting corrupted originally, but the PHP version change seemed to resolve it.

    Hope life is treating you well!
    Marcus

    Pooka & Co
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.