Opened 3 years ago

Last modified 2 years ago

#14893 new defect (bug)

wp_inactive_widgets sidebar forgotten, then does notice in /wp-admin/widgets.php

Reported by: hakre Owned by:
Priority: normal Milestone: Future Release
Component: Warnings/Notices Version: 3.0.1
Severity: normal Keywords: has-patch
Cc:

Description

The 'wp_inactive_widgets' is not initalized but used later on.

Can be fixed easily by adding it while the array get's initialized.

Attachments (1)

14893.patch (919 bytes) - added by hakre 3 years ago.

Download all attachments as: .zip

Change History (7)

  • Summary changed from wp_inactive_widgets sidebar forgotten, than does notice in /wp-admin/widgets.php to wp_inactive_widgets sidebar forgotten, then does notice in /wp-admin/widgets.php

hakre3 years ago

Mm, I'm suspecting the suggested patch will break some upgrade/backwards compatibility code we introduced around WP 2.8. It's better use isset() where needed to avoid the notices when there are any.

comment:3 in reply to: ↑ 2   hakre3 years ago

Replying to Denis-de-Bernardy:

Mm, I'm suspecting the suggested patch will break some upgrade/backwards compatibility code we introduced around WP 2.8. It's better use isset() where needed to avoid the notices when there are any.

Can you please make that suspection concrete with the patch because I do not see the problem here.

Can't recall the specifics, but it had to do with issues upgrading very old sites (prior to 2.5). The widgets were moved around in sidebars, basically. A cursory search leads to these:

#9695, #10092, r11164

Tons more here, for your reading pleasure: #9511. don't forget to look around in related tickets, and related to related tickets.

Alternatively, trust me a take this short short version at face value: the WP widgets API will blow up in your face on changes like the one you suggest, and it's better to add whatever isset() calls are needed until it's rewritten from the ground up.

  • Milestone changed from Awaiting Review to Future Release

How many places would isset() checks be required to squash the notices? If it's just a handful, do that.

Note: See TracTickets for help on using tickets.