WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6424 closed defect (bug) (wontfix)

erroneous widget count for sidebars

Reported by: Denis-de-Bernardy Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 2.5
Component: Plugins Keywords: widget
Focuses: Cc:

Description

activate a plugin that adds new widgets, and insert that widget in a sidebar. You get something like:

"You are using 2 widgets in the "Sidebar" sidebar."

deactivate the plugin. the widget no longer exists. You still get:

"You are using 2 widgets in the "Sidebar" sidebar."

Change History (6)

comment:1 @Viper007Bond7 years ago

  • Keywords needs-patch added
  • Priority changed from low to lowest
  • Severity changed from minor to trivial

Thought I'd throw in an explanation of what's going on since I've been working with widgets lately.

This is happening because that plugin's widget is still technically in the sidebar, but it just doesn't show up because it doesn't exist. Note that if you re-activate the plugin, the widget will be back in your sidebar exactly where you put it rather than on the left side in the unused widgets list. If you hit save which will refresh the sidebar array, the non-existent widget will be removed.

This inaccurate count occurs because that number is just a simple count($widgets) and done before the widgets are outputted and actually checked to see if they exist.

comment:2 @lloydbudd7 years ago

  • Milestone changed from 2.5 to 2.6

comment:3 @scribu7 years ago

Bug #8035 is related to this one.

comment:4 @jacobsantos7 years ago

  • Component changed from Administration to Plugins
  • Keywords widget added; needs-patch removed
  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

WordPress widgets are going to get an overhaul in 2.9 and hopefully they would have corrected the cause of this.

The reason for this is that the sidebar widget option is not being updated. Really it could be considered the fault of the plugin author for not removing their widget, but WordPress should also consider sidebars that no longer exist and widgets that no longer exist.

comment:5 @jacobsantos7 years ago

This is not really trivial.

comment:6 @Denis-de-Bernardy7 years ago

agreed, plus it's only cosmetic. but it's still a bug. ;-)

D.

Note: See TracTickets for help on using tickets.