The MU forums have moved to WordPress.org

Upgrade problem (widgets.php) (13 posts)

  1. maagicci
    Member
    Posted 16 years ago #

    Hi!

    I've searched this forum multiple times, but haven't found a solution to my problem. Please help.

    I'm running wpmu 1.2.4 and have tried to upgrade to every released version after that but they all caused same type of situation that every blog's text widgets disappear. The blog's sidebars are not showing up at all. It can be fixed manually by going Presentation (or Design in newer releases) -> Widgets and make a text widget from scratch. But I don't want my users to lose their text-widget writings during the upgrade!

    I've tried to upgrade step-by-step 1.2.4->1.2.5a->1.3->... and straight from 1.2.4 to 2.6b1 but same thing happens every time. (All upgrade installs "vanilla" with no plugins or other modifications)

    After upgrade apache error log shows errors about widgets.php.

    Newest release (2.6b1):

    PHP Warning: array_keys(): The first argument should be an array in /xxx/yyy/wp-includes/widgets.php on line 686

    And in 1.2.5a:

    PHP Fatal error: Cannot use string offset as an array in /xxx/yyy/wp-includes/widgets.php on line 531

    I think the problem is not in the widgets.php. My guess would be something related to database but where to look from?

    I'm using PHP 5.2.6+Apache 2.2.4+MySQL 5.0.45.

    Big thanks in advance!

  2. andrea_r
    Moderator
    Posted 16 years ago #

    Hmm.. wasn't one of those early versions without built-in widgets?

  3. lunabyte
    Member
    Posted 16 years ago #

    Probably. Can't remember where it all came into play, but it was around that time that widgets were moved into the core.

    Also, after that time there were some files in mu-plugins which were moved to the core as well. They would need removed from mu-plugins, as they will cause errors.

    Also, one "fix" for the first error you lists was to go in and resave your widgets under the design/presentation menu in wp-admin.

  4. maagicci
    Member
    Posted 16 years ago #

    The widgets are already in the "core" in 1.2.4 version. But doesn't seem to work in any later version after upgrade.

    Also while running the "Upgrade" process through admin-interface apache2 error_log shows up:

    PHP Warning: array_keys(): The first argument should be an array in /xxx/yyy/wp-includes/widgets.php on line 1352, referer: http://xxx.yyy/wp-admin/wpmu-upgrade-site.php?action=upgrade

    And as I previously said the upgrade versions are ran without any mu-plugins what so ever.

  5. MrBrian
    Member
    Posted 16 years ago #

    Those errors are caused by the 'widget_text' and 'widget_rss' option in wp_X_options. The data in there is probably not an array, you should paste it here.

  6. maagicci
    Member
    Posted 16 years ago #

    OK. How can I know is it an array or not? Here from main blog wp_1_options table's widget_text and widget_rss:

    (snap'd from the sql dump's insert clause)

    Can been seen here.

    How to continue?

  7. MrBrian
    Member
    Posted 16 years ago #

    I'm guessing because of the non english characters, there are some issues when serializing that data into an array. don't know how to fix though =/

  8. maagicci
    Member
    Posted 16 years ago #

    Thanks for the info MrBrian. But shouldn't UTF-8 take care of those kind of unicode problems?

    And is the serializing technique changed somehow in 1.2.5 version? Earlier upgrades have gone through without any problems.

    This is very important issue for site's users and will probably cause many complaints if the text widgets are lost in upgrade? Anyone having any helpful thoughts?

  9. lunabyte
    Member
    Posted 16 years ago #

    Did you go to the widgets page in the admin area, and resave them?

    That's worked for this before, and might for you.

  10. maagicci
    Member
    Posted 16 years ago #

    If I go to edit the text widget in admin area after upgrade it is totally empty. Saving truly fixes the problem, but then the original text is already gone to bit heaven. And that is what I don't want to happen.

  11. maagicci
    Member
    Posted 16 years ago #

    Still no solution to this problem?

  12. IdaWebCo
    Member
    Posted 16 years ago #

    I seen a similar issue and it had to do with multiple instances of the same widget. I don't know if this is related but in the spirit of sharing, here is what happened.

    The error you described here appeared on a friends WPMU site after he moved it to a new server. The only blogs that seem to have this problem were blogs that displayed multiple RSS Feeds using the RSS Widget.

    The solution was to remove each feed, then add them back one by one. The issue was then resolved. I believe having multiple instances of the text widget on a blog could cause the same issue under this circumstance.

  13. johanl
    Member
    Posted 15 years ago #

    I have had the same problem! There was a row in the wp_options table with option_name = 'widget_text' that caused the error.

    To fix the problem: login to mysql
    select * from wp_options where option_name = 'widget_text';

    Examine the result. The row that caused the problem for me had swedish characters in the option_value column.

    Delete rows that may cause the error.
    delete from wp_options where option_id = xx;

    Where xx is the id from the listing in the select statement.

    Or you can simply delete all rows with option_name = widget_text
    delete from wp_options where option_name = 'widget_text';

    Note that this deletes one or more of your "Text" widgets!

    Error occurs for me when I copy production data to my test environment.

    Good luck!
    /Johan Linderoth, http://www.barnhemmet.se

About this Topic