Support » Installing WordPress » Fatal error in Dashboard, “Unsupported operand types” ?

  • The upgrade went smoothly and everything is fine *except* in the Dashboard, where I am supposed to get widgets I get

    Fatal error: Unsupported operand types in /path/to/wp-admin/index.php(101) : runtime-created function on line 1

    I can’t tell if that is a PHP version error (I’m on 4.3.2) or a problem with a plugin (I deactivated all, same problem) or what. Anybody else experience this? I’m seeing other fatal errors on the forum but not this one.

    Fortunately everything else is working. Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • I am also getting this error – also on PHP 4.3.2. Does anyone have any ideas on how to sort it?

    I’m stuck too. Just that one error that stops the widgets from displaying in the dashboard. Everything else seems fine.

    Based on some of the other issues people had with php and mysql versions when upgrading from 2.1 to 2.2 I’m guessing it’s a similar issue.

    Can anyone verify they have WP2.5 working without this issue using the following setup or similar?

    Current WordPress version 2.5
    Server operating system Linux
    Current version of PHP PHP 4.3.2
    Current version of MySQL MySQL 4.1.22-standard
    Webserver software Apache/2.0.46 (Red Hat)

    Any help you could give would be much appreciated.

    Works fine with this setup:

    Current WordPress version: 2.5
    Server operating system: Linux
    Current version of PHP: PHP 4.4.8
    Current version of MySQL: MySQL 4.1.11-Debian_4sarge7-log
    Webserver software: Apache/2.0.54

    All plugins disabled didn’t solve the problem.

    can you post line 1 of your index.php file?

    First ten lines:

    require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
    function index_js() {

    I’ve got the exact same error in mine.

    Commenting out lines 98 through 111 in wp-admin/index.php removed the fatal error, so the widgets show. You don’t get theme- and widget-related links in the “Right Now” box is all.

    So based on lisamac’s comment, PHP 4.3.2 must have a problem with this

    $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) );

    donzacharias, do you mind posting lines 98 through 111 so I know exactly what to comment out. I commented mine 98-111 out but I am still getting error so maybe I’m not commenting the correct lines in wp-admin/index.php

    This time it’s:
    Warning: Unknown modifier ‘d’ in …plugins/wordpress-dashboard-editor/dashboard.php on line 109

    Here is the fix. I tried it out and it worked great. I got it from this post:

    This is a bug in wordpress. It’s going through a list of lists of stuff in the sidebar, and adding up the lengths of each list. The problem is that the initial sum is NULL rather than 0. Fix is to add ,0 right before the last end paren.

    Like so:

    $num_widgets = array_reduce( $sidebars_widgets, create_function( ‘$prev, $curr’, ‘return $prev+count($curr);’ ), 0 );

    . . so just add the ====> ,0
    like above and try. Make sure you have a backup of your wp-admin/index.php file first. I initially forgot to add the comma and could not get into the admin at all.

    Thanks. I patched my 2.5.1 install. Would be nice if it eventually gets fixed for good, but thanks for the solution.

    SidVision, adding the zero did the trick. Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Fatal error in Dashboard, “Unsupported operand types” ?’ is closed to new replies.