• Resolved strarsis

    (@strarsis)


    When editing/creating a new post in WordPress admin interface,
    the post editor page doesn’t load and a fatal error occurs:

    
    Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/web/app/plugins/event-post/eventpost.php:465 Stack trace: #0 /var/www/web/wp/wp-includes/class-wp-hook.php(298): EventPost->admin_scripts('') #1 /var/www/web/wp/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #2 /var/www/web/wp/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /var/www/web/wp/wp-admin/admin-header.php(125): do_action('admin_print_scr...') #4 /var/www/web/wp/wp-admin/edit-form-advanced.php(473): require_once('/var/www/web/wp...') #5 /var/www/web/wp/wp-admin/post-new.php(85): include('/var/www/web/wp...') #6 {main} thrown in /var/www/web/app/plugins/event-post/eventpost.php on line 465
    

    After disabling this plugin, the post editor page opens normally again.

    • This topic was modified 7 years, 10 months ago by strarsis.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter strarsis

    (@strarsis)

    This is because of a change in PHP 7.1.0 (https://github.com/spotweb/spotweb/issues/243#issuecomment-265461670):

    The empty index operator (e.g. $str[] = $x) is not supported for strings
    anymore, and throws a fatal error instead of silently converting to array.

    This can be fixed by adding a line to initialize the array first

    $deps = [];

    directly above the existing line at (plugins/)event-post/eventpost.php:465 :

    $deps[] = ‘jquery-ui-datepicker’;

    Then lines 465-466 will look like:

    $deps = [];
    $deps[] = ‘jquery-ui-datepicker’;

    Then the plugin seems to work.

    Plugin Author Bastien Ho

    (@bastho)

    thank you for the report and the solution, a fix have been added for the next release.

    Plugin Author Bastien Ho

    (@bastho)

    Done ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal error when editing/creating post’ is closed to new replies.