WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 3 weeks ago

#38469 reopened defect (bug)

wp-includes/widgets.php:1208 Undefined index: wp_inactive_widgets

Reported by: onnimonni Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.6.1
Component: General Keywords: bulk-reopened
Focuses: Cc:

Description

Hey!

Multiple persons can reproduce this error in our company.

After I switch themes I'll get notice about widgets.

It happens in wp-includes/widgets.php:1208

I'm using custom wp-content/install.php which doesn't add any widgets because we don't usually use them at all.

This problem gets fixed when I add this snippet in my mu-plugins:

<?php
add_action( 'init', function() {
    global $sidebars_widgets;
    if (!isset($sidebars_widgets['wp_inactive_widgets'])) {
        $sidebars_widgets['wp_inactive_widgets'] = [];
    }
});

Custom install.php can be found here: ​https://github.com/devgeniem/better-wp-install-dropin/blob/master/install.php

Details:

$ wp core version
4.6.1

$ php -v
PHP 7.0.12-1

Change History (3)

#1 @onnimonni
2 years ago

This can also be fixed by adding following line to install.php:

<?php
update_option( 'sidebars_widgets', array( 'wp_inactive_widgets' => array() ) );

We should either document this behaviour into codex or core should have fix which handles this situation automatically.

#2 @iseulde
3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

#3 @JeffPaul
3 weeks ago

  • Keywords bulk-reopened added
  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

A ​decision was made to reopen tickets that were closed in the bulk edit that this ticket was affected by. This ticket is being placed back into the Awaiting Review milestone so it can be individually evaluated and verified to determine if it is still relevant/valid or reproducible.

Note: See TracTickets for help on using tickets.