WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 8 months ago

#14893 closed defect (bug) (worksforme)

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

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Warnings/Notices Keywords: has-patch
Focuses: 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 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 hakre4 years ago

  • 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

hakre4 years ago

comment:2 follow-up: Denis-de-Bernardy4 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 hakre4 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.

comment:4 Denis-de-Bernardy4 years ago

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

comment:5 Denis-de-Bernardy4 years ago

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.

comment:6 markjaquith3 years ago

  • 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.

comment:7 follow-up: alexvorn28 months ago

have the same issue, the problem is that the notice appears only once ( after theme actiavation ) :

wp_inactive_widgets in D:\Dropbox\htdocs\wordpresslastmu\wp-includes\widgets.php on line 1266

comment:8 in reply to: ↑ 7 ; follow-up: SergeyBiryukov8 months ago

  • Keywords reporter-feedback added

Replying to alexvorn2:

have the same issue, the problem is that the notice appears only once ( after theme actiavation )

The code was changed in #17979. Could you please add the steps to reproduce? Does it happen with a specific theme?

comment:9 in reply to: ↑ 8 alexvorn28 months ago

Replying to SergeyBiryukov:

The code was changed in #17979. Could you please add the steps to reproduce? Does it happen with a specific theme?

everything is fine now, I made some modifications and the sidebars[wp_inactive_widgets] javascript value from widgets.php page were missing in the widgets data array (js)

comment:10 SergeyBiryukov8 months ago

  • Keywords reporter-feedback removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.