Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 months ago

#33489 closed defect (bug) (duplicate)

Widget without any settings

Reported by: technicaldev's profile Technicaldev Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Widgets Keywords:
Focuses: Cc:

Description

Hello,

Since Wordpress version 4.3 there has been a code change which has disabled my plugin for all users that have upgraded (with no error message etc).

Upon investigation, it appears a code change has been made within the file 'wp-includes/widgets.php' on line 317. "array_key_exists" has been replaced with "isset". This requires that the value is not NULL. As my widget has no settings (no title etc), the "$instances[ $this->number ]" value is NULL and this has therefore resulted in my widget no longer displaying.

Could you please advise whether this is a bug or whether we are going to have to change the plugin to store an empty array etc.

Thanks.

Change History (1)

#1 @westonruter
9 years ago

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

@Technicaldev: Thanks for the report. This issue was actually reported elsewhere in #33442. The issue will be “fixed” in 4.3.1, however as you can read in the comments on the ticket, I would argue that the plugin is doing the wrong thing by returning null from the WP_Widget::update() method. WordPress is expecting this method to be returning an array, even an empty one. So for the immediate fix, I recommend updating the plugin to return an array instead of null. Thanks!

Note: See TracTickets for help on using tickets.