WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6349 closed defect (bug) (fixed)

Widget titles can be repetitive

Reported by: mdawaffe Owned by: mdawaffe
Milestone: 2.5.1 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

If you add a new widget, you'll often get a repetitive title in the admin.

Meta: Meta

We should test for this duplication and nip it in the bud.

Attachments (3)

6349.diff (682 bytes) - added by mdawaffe 6 years ago.
6349.b.diff (1.1 KB) - added by mdawaffe 6 years ago.
6349.c.diff (1.4 KB) - added by mdawaffe 6 years ago.

Download all attachments as: .zip

Change History (13)

mdawaffe6 years ago

comment:1 matt6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [7467]) Don't dupe widget titles. Fixes #6349. Hat tip: mdawaffe.

comment:2 Viper007Bond6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Shouldn't the patch be this?

if ( $widget_title && $widget_title != $sidebar_args['widget_name'] )

The original patch fixes it for the default plugins, but it's still possible to get the repetitive title bug if $widget_title != $control['name'] but $widget_title == sidebar_args['widget_name'], which it does with what I'm doing.

comment:3 follow-up: mdawaffe6 years ago

Hm... Actually - I think the references in those few lines to $sidebar_args['widget_name'] are incorrect; they should reference $control['name'], shouldn't they?

When are those two different?

comment:4 in reply to: ↑ 3 Viper007Bond6 years ago

Replying to mdawaffe:

When are those two different?

They are different with the dashboard widgets apparently.

My plugin which results in the double titles: http://files.viper007bond.com/wordpress/dashboard-widget-manager_1.0.0beta.zip

We're comparing variables A and B and then displaying variables A and C. We should either compare A and C or display A and B, i.e compare and display the same variables.

comment:5 mdawaffe6 years ago

  • Keywords has-patch commit added

It looks like we're displaying the widget name everywhere rather than the widget control name. This is probably an oversight, but it's too late to change for 2.5 now.

Attached makes everything consistent by using the widget name.

mdawaffe6 years ago

mdawaffe6 years ago

comment:6 mdawaffe6 years ago

6349.c.diff incorporates all of 6349.b.diff and fixes a bug when adding new multi-widgets (extant titles were erroneously being appended to new instances of multi-widgets).

comment:7 mdawaffe6 years ago

5823.a.diff on #5823 incorporates 6349.c.diff

comment:8 mdawaffe6 years ago

  • Milestone changed from 2.6 to 2.5.1

comment:9 ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [7725]) Tweak unused widgets interface. Make widget titles less repetitive. fixes #6349 #5823 for 2.5

comment:10 ryan6 years ago

(In [7726]) Tweak unused widgets interface. Make widget titles less repetitive. fixes #6349 #5823 for trunk

Note: See TracTickets for help on using tickets.