Forums

[resolved] Warning: array_keys() [function.array-keys]: (25 posts)

  1. thedailymatters
    Member
    Posted 5 months ago #

    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

  2. philnet
    Member
    Posted 5 months ago #

    I got the same message after a blog migration. I don't even touched a file...

    Plz help!

  3. marcel.dekorte
    Member
    Posted 5 months ago #

    And here is another one with the same problem

  4. Otto42
    Moderator
    Posted 5 months ago #

    This is due to the text widget not having the right kind of data in it. A lot of people get it after upgrading for some reason.

    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.

  5. ronchicago
    Member
    Posted 5 months ago #

    wow, lucky i found you. a problem for days! here is what caused error to appear. i upgraded from v2.1.1 with a load of plugs/widgets using sidebar widgets. i deleted all the plugins prior to the upgrade because i was locked out of admin = this forced me into upgrading to 2.5 = no problems.

    once 2.5 was up i added plugins "wp-gbcf" "sidebar widgets" "simple tagging" "simple tagging widget" well i could not see a lot of my widget_text content from v2.1.1 and deactivated "all plugs" = the aforementioned error.

    now to figure out the new widget setup as my prior setup had a lot of text widgets including php variety. thanks again otto!

  6. lpantos
    Member
    Posted 5 months ago #

    thanks. I just went into widgets.php and clicked save changes and I'm set. Weird but great

  7. lpantos
    Member
    Posted 5 months ago #

    I spoke too soon. It allowed me to view the blog but there are still errors at the top of the page and I get the errors when I try to get into the admin section.

  8. maery
    Member
    Posted 4 months ago #

    i got the same problem in www.abk-redemptoristen.de

    my update was really risky: from 2.0.somewhat to 2.5.1 (german). afterwards i got all these kind of error messages from above and i am not able to login to the adminpanel. the widget row is not there in the db and i cannot reach the widget.php...

    some help out there?

  9. PaniniKathy
    Member
    Posted 4 months ago #

    Same thing happened to me after I just added a new text widget. Now all my widgets have disappeared (except the ones that came with my cutline theme) and error messages are appearing at the top of the page on my live blog (not good!) and in the admin panel.

    I just moved over to wordpress 1 week ago from blogger, so I'm very new at making backend changes on this platform. Some step-by-step guidance would be much appreciated - thank you!

  10. duluoztrip
    Member
    Posted 4 months ago #

    I am new to this as well, I am getting the same error message and cannot login to my control panel at all... here is the problem www.yourmusicsucks.com It happened after I tried to add a new text widget. Any help would be appreciated, thanks!!!

  11. ansong
    Member
    Posted 3 months ago #

    I received the same error as you guys upgrading from 2.5 to 2.5.1.

    Warning: array_keys() [function.array-keys]: The first argument should be an array...

    I narrowed it down to this line from the newer wp-config.php:

    define('DB_CHARSET', 'utf8');

    I use dreamhost, maybe they're not using utf8? In any case, after removing that line, all was well. I hope this helps someone.

  12. waterhead37
    Member
    Posted 3 months ago #

    I have the same problem although it didn't happen immediately upon upgrading.

    I can't log in as admin and thus cant try some of the solutions offered. I checked my config file and because I haven't changed it through several upgrades of Wordpress it didn't have the line

    define('DB_CHARSET', 'utf8');

    at all. When I ftp'd the newer version across with this line in it, I still had the problems plus an accented word in my most recent post was suddenly showing garbage. I am wondering if the problem has to to with accented text in some way?

    I am not sure what to try next.

    This issue is NOT resolved

  13. Luffy
    Member
    Posted 3 months ago #

    After a restore of my database locally, I get the error.
    To fixed it, I went to the widget panel and changed all the text in widget title.
    I fixed the error message, but now I can't change the widget title (Recent Post for example still keep '5' as title, each time I change the title and press Save Changes, the title is '5' ).

    Luffy

  14. Luffy
    Member
    Posted 3 months ago #

    I've found my problem :
    1) There was a difference between my two database. The first was UTF-8 Unicode (utf8) and latin1_leneral_ci, but the second was UTF-8 Unicode (utf8) and utf8_bin.
    2) When I've imported the data from the first base to the second the character of the sql file was set to utf8 instead of latin1.

    So I did the following :
    Set my second database to UTF-8 Unicode (utf8) and latin1_leneral_ci.
    Choose latin1 character set during the backup importation on the second base.

    If you ve yhe same error take a look on the character paramters of your new database, and you'll find the solution.

    Hope it'll help somebody.

    Luffy.
    (WORDPRESS 2.5)

  15. 1hkcook
    Member
    Posted 2 months ago #

    hi, newbie here but wordpress user since day1. problem (a silly one) but still problem. I tried to read through here but cannot find a thread to help. hence i post. my 3rd party widgets have disappeared completely, warning message flash above wordpress dashboard. How to fix it when I cannot even find the widget i need to remove.

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

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

    this is basically it. if i am in the wrong room here, please redirect me to the right forum room.

    www.childhoodspeech.com

  16. jeannedb
    Member
    Posted 2 months ago #

    Same problem but I was already using 2.5.1. I added the following as a text widget:

    <p align=”center”><a href=”http://www.5minutesforspecialneeds.com” mce_href=”http://www.5minutesforspecialneeds.com”><img src=”http://www.5minutesforparenting.com/wp-content/uploads/2008/07/special-needs-125×125-1.png” mce_src=”http://www.5minutesforparenting.com/wp-content/uploads/2008/07/special-needs-125×125-1.png” alt=”5 Minutes for Special Needs” class=”alignnone size-full wp-image-19″ height=”125″ vspace=”10″ width=”125″></a>

    I assumed this would be the solution since it happened IMMEDIATELY after adding code in a text widget:

    This is due to the text widget not having the right kind of data in it. A lot of people get it after upgrading for some reason.

    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.

    But the widget_text row isn't even showing up in wp_options. All of my text widgets disappeared.

    UPDATING AS I'M POSTING -

    When I tried to add a new Text Widget as a test, I lost the whole site and only the error message showed. I backed into my control panel and removed the test Text Widget and now everything is back with the exception of all my previous Text Widgets (gone forever I assume - oh well).

    I just tried another test Text Widget and it worked fine.

    So apparently, there is something in that code that caused my Text Widgets to go Kaflooey (the code is being distributed by another WordPress blog to be used to post their ad. I will be informing them). I included the code because I thought someone might know why it screwed things up.

  17. cheetah1
    Member
    Posted 2 months ago #

    Oh well, I got about the same errors as the OP, and another one. Can someone simply tell me what's wrong?

    Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/arkiv.cristianswebsite.org/wp-includes/widgets.php on line 1352
    
    Warning: Invalid argument supplied for foreach() in /var/www/arkiv.cristianswebsite.org/wp-includes/widgets.php on line 1352
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/arkiv.cristianswebsite.org/wp-includes/widgets.php:1352) in /var/www/arkiv.cristianswebsite.org/wp-includes/pluggable.php on line 770
  18. chaosphoenix
    Member
    Posted 2 months ago #

    Same for me here.

  19. dorfun
    Member
    Posted 2 months ago #

    If you have this error:

    Warning: array_keys() [function.array-keys]: The first argument should be an array in [...] on line 1352

    Try to deactivate all widgets (and no only plugins). Use a widget-ready theme, deactive all them... and maybe will be ok! :)

    It works for me.

  20. totof2k2
    Member
    Posted 2 months ago #

    Hello Dorfun

    Can you tell me, how you can desactivate all widgets ? i can't acces to my admin panel...
    all Plugins are OFF,

    thanks for your help

    christophe

  21. wikichaves
    Member
    Posted 2 months ago #

    Hi !

    i have the same problem ? how can i desactivate the widgets . i can´t access to my admin panel

    take a look

    http://wikichaves.com/blog/
    http://wikichaves.com/blog/wp-admin/

    thanks !
    francisco

  22. cheetah1
    Member
    Posted 1 month ago #

    Well, I have to ask the same. How do you do that when you can't access the gui?

  23. mercime
    Member
    Posted 1 month ago #

    The fastest way to de-activate widgets when you cannot access your WP admin is by deleting the plugin from FTP.

  24. davosian
    Member
    Posted 1 month ago #

    Here is how I fixed it:

    To gain access to your widget page, simply comment out two lines of your wp-config.php file:

    // define('DB_CHARSET', 'utf8');
    // define('DB_COLLATE', '');

    Then log in and go to your widget page.
    Remove each text widget and PHP widget (copy the content into a text editor so you can retrieve it afterwards again).
    Go back into your wp-config.php file and remove the comments again. Save.
    Log in and add your text widgets again. This should work fine now.

  25. beritany
    Member
    Posted 4 days ago #

    here's what comes to my blog after i tried to log-in

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

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

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-login.php on line 267

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-login.php on line 279

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-includes/pluggable.php on line 595

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-includes/pluggable.php on line 596

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-includes/pluggable.php on line 597

    Warning: Cannot modify header information - headers already sent by (output started at /home/beritany/public_html/wp-includes/widgets.php:686) in /home/beritany/public_html/wp-includes/pluggable.php on line 770

    can anyone help me? i cant log in, i cant remove my widgets, and i dont even know what mistakes that i made....

Reply

You must log in to post.

About this Topic

Tags