• Resolved Boris

    (@travel-junkie)


    Hello,

    yesterday night my server got updated to PHP5 and MySQL5. Now this morning I am getting these warnings on my site:

    Warning: array_keys() [function.array-keys]: The first argument should be an array in /www/htdocs/w006dc1d/travelogues/wp-includes/widgets.php on line 686
    
    Warning: Invalid argument supplied for foreach() in /www/htdocs/w006dc1d/travelogues/wp-includes/widgets.php on line 686

    The admin area can’t be accessed at all. That’s what I’m getting there:

    Warning: array_keys() [function.array-keys]: The first argument should be an array in /www/htdocs/w006dc1d/travelogues/wp-includes/widgets.php on line 686
    
    Warning: Invalid argument supplied for foreach() in /www/htdocs/w006dc1d/travelogues/wp-includes/widgets.php on line 686
    
    Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w006dc1d/travelogues/wp-includes/widgets.php:686) in /www/htdocs/w006dc1d/travelogues/wp-includes/pluggable.php on line 770

    Any help would really be appreciated. Here’s a link to my site: http://travel-junkie.com/
    Thanks,
    Boris

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

    (@travel-junkie)

    Hey,

    ok, I figured out that if I uncomment in wp-includes/widgets.php these lines starting from line 686 that everything turns back to normal:

    foreach ( array_keys($options) as $o ) {
    		// Old widgets can have null values for some reason
    		if ( !isset($options[$o]['title']) || !isset($options[$o]['text']) )
    			continue;
    		$id = "text-$o"; // Never never never translate an id
    		wp_register_sidebar_widget($id, $name, 'wp_widget_text', $widget_ops, array( 'number' => $o ));
    		wp_register_widget_control($id, $name, 'wp_widget_text_control', $control_ops, array( 'number' => $o ));
    	}

    Surely there has to be another way, though. I am not using any widgets on my blog, I don’t even have a sidebar, so that’s probably why this works for me.

    Cheers,
    Boris

    Thread Starter Boris

    (@travel-junkie)

    There are also problems with the Contact Form 7 and the Buy Me Beer plugins not displaying properly.

    Thread Starter Boris

    (@travel-junkie)

    Maybe I should have searched for this first. Sorry for that. For everybody with a similar problem, here’s the solution for all my problems.

    Adding this to my theme’s functions.php, deleting my browser cache and then loading the site again fixed all the warnings and errors:
    delete_option('widget_rss');

    You have to remember to delete that line again once the warnings have disappeared.

    All my special characters, plus a couple plugins (Buy Me Beer & Contact Form 7), were mangled. Commenting this line out of my wp-config.php file solved all that:
    define('DB_CHARSET', 'utf8');

    Thanks to Otto42 for that!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Errors after upgrade from PHP4 to PHP5’ is closed to new replies.