• Resolved thedailymatters

    (@thedailymatters)


    Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/ymaindomain/public_html/mydomain/wp-includes/widgets.php on line 676

    Warning: Invalid argument supplied for foreach() in /home/mymaindomain/public_html/mydomain/wp-includes/widgets.php on line 676

    What could this error mean? I got this after adding some code to my widget Please help. ASAP

Viewing 11 replies - 31 through 41 (of 41 total)
  • I just moved my sites to an upgraded server, running identical software to the one they left. I should say “apparently” identical because every one of my wordpress blogs is fluggered…

    https://www.oliverbc.ca
    https://www.winecapital.ca
    https://www.canadianwinetours.com

    All have one or another of the error discussed here. I tried removing suggested lines from the widgets.php file and from my wpconfig file, nothing seems to fix this. I have no text widgets. Help…!

    OK I resolved the issue above… the answer to my problem was MAGIC QUOTES – once I turned them OFF in my php.ini (or it could be done through cpanel) all the error message went away.

    What is this error?:
    Warning: array_keys() [function.array-keys]: The first argument should be an array in Testing\wp-includes\widgets.php on line 1349

    Warning: Invalid argument supplied for foreach() in Testing\wp-includes\widgets.php on line 1349

    I figured out what caused this error for me. My blog was working fine, but my local copy was getting the array_keys() error. It turns out it was due to an issue I’ve run into many times before while exporting a database from phpMyAdmin.

    For some reason, phpMyAdmin inserts garbage after EVERY LINK in your database content. So if you have a database row with <a href="mylink"> in the data, it will end up looking something like <a href="mylink?phpMyAdmin=hxLEzQ1rOQcEE5fSSzkpIuPI8E7">. Obviously, this causes all kinds of issues.

    The only way I’ve found to stop this behavior is to NOT check “save as file” when exporting your database. Just click “Go” and let the dump print to screen. Then copy/paste it into a text file and import that into your local (or wherever) database.

    Thanx Otto

    I have moved my site to a new server and now the text widgets do not work at all. I had the array error after I moved it as well that is now gone BUT I can not use text widgets at all.

    I had the same problems, getting the error message:
    Warning: array_keys() [function.array-keys]: The first argument should be an array in Testing\wp-includes\widgets.php on line 1044

    Warning: Invalid argument supplied for foreach() in Testing\wp-includes\widgets.php on line 869

    Turns out it’s an error you get when importing from a database using a different utf.
    My brother managed to fix the problem by deleting the following code in wp-config.hp: /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    Good luck to others with the same problem!

    Had the same problem after migrating to a new server. The problem was character encoding. Make sure to use utf-8 encoding when exporting/importing your database via phpMyAdmin, CocoaMySQL, etc.

    Please someone help!

    I’m getting this error as well so many others while trying to figure out what I did wrong.

    I added some html into my text box widget and the next thing I know every page has an error. So I look for a solution and find the deal on how to edit the wp-config for it. This only made it to where I can no longer access my wp-admin or my website. I’m seriously freaking out. I’ve tried every solution I’ve been able to google and still no luck.

    Parse error: syntax error, unexpected '*' in /home/elibrumb/public_html/artstormhouston.com/wp-config.php on line 2

    This is the current error message.

    Like all of you that wrote in I had this problem as well. I went through and tried the many suggestions posted here and managed to really screw things up bad.

    So bad that a two year old site defaulted to a new installation!! I was mad as heck!!

    I went back through this and noticed that someone had thanked Otto42. So I went and looked at what he wrote. It seems like the first time I read his reply I missed it.

    If you go and edit all your text widgets and then save changes, this should go away. Worst case, manually edit your database, find the widget_text row in wp_options, and remove it. Then put your text widgets back.

    This solved the problem. Before trying anything else please try this first!

    Thank you Otto42!

    This worked for me:

    wp-options > option_name > widget_text

    Removed the widget_text, as advised.

Viewing 11 replies - 31 through 41 (of 41 total)
  • The topic ‘Warning: array_keys() [function.array-keys]:’ is closed to new replies.