• When performing a basic WP core action ( update_option() ) one of the option_keys began with em_.

    There is apparently something in the latest version of EM free that interferers:
    Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /Users/Patrick/Sites/Development/wp-content/plugins/events-manager/classes/em-options.php:22 Stack trace: #0 /Users/Patrick/Sites/Development/wp-content/plugins/events-manager/admin/em-options.php(328): EM_Options::get('updates') #1 /Users/Patrick/Sites/Development/wp-includes/class-wp-hook.php(288): em_options_save('') #2 /Users/Patrick/Sites/Development/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #3 /Users/Patrick/Sites/Development/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #4 /Users/Patrick/Sites/Development/wp-admin/admin.php(170): do_action('admin_init') #5 /Users/Patrick/Sites/Development/wp-admin/edit.php(10): require_once('/Users/Patrick/...') #6 {main} thrown in /Users/Patrick/Sites/Development/wp-content/plugins/events-manager/classes/em-options.php on line 22

    It crashes the whole website as this is a fatal error! Only when I comment out line 339 of em-options.php the site runs again. But as soon as I uncomment it, it crashed again.

    Even restarting the server itself does not solve this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Stonehenge Creations

    (@duisterdenhaag)

    I found the error!

    In classes/em-options.php line 22 says:
    if( !empty($data[$option_name]) ){

    But a simple test:
    error_log( print_r( $data, true) );
    reveals this:

        [admin_notices] => stdClass Object
            (
    

    Before line 22 I now added:

    if( !is_array($data) ) {
    	return $default;
    }

    Hi Partick,

    Thanks for checking on the issue. I have forwarded this to our Dev for them to double check also. Do you perhaps any specific steps on how to properly replicate the issue? I’m currently trying to create, edit, delete events or locations, I also tried adding/changing bookings forms and so far I don’t experience the issue.

    Thread Starter Stonehenge Creations

    (@duisterdenhaag)

    Hi Tim,
    I was updating my EM Mollie Payment add-on and the options were changed.

    It gets even worse though… First I thought the error came from “admin_notices’ not being an array and that that came from deactivating the Pro version on my localhost for reasons you know.

    Yet, I also got the same errors for user-fields.php and two more. All the same error “stdClass as array”, but in different files. So I’m “guessing” they all check for the same thing that gives an error. My test revealed ‘admin_notices” to be an Object, while called as array.

    A full WP Reset did not get it running again, so the only thing left was another WP Reset and a downgrade to the Free version of September 2019.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SITE CRASHED on update_option.’ is closed to new replies.