Ticket #6349 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

Widget titles can be repetitive

Reported by: mdawaffe Assigned to: mdawaffe
Priority: normal Milestone: 2.5.1
Component: General Version: 2.5
Severity: normal Keywords: has-patch commit
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

6349.diff (0.7 kB) - added by mdawaffe on 03/22/08 07:30:40.
6349.b.diff (1.1 kB) - added by mdawaffe on 03/28/08 18:18:15.
6349.c.diff (1.4 kB) - added by mdawaffe on 03/28/08 18:38:49.

Change History

03/22/08 07:30:40 changed by mdawaffe

  • attachment 6349.diff added.

03/22/08 07:35:12 changed by matt

  • status changed from new to closed.
  • resolution set to fixed.

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

03/23/08 10:05:25 changed by Viper007Bond

  • status changed from closed to reopened.
  • resolution deleted.

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.

(follow-up: ↓ 4 ) 03/24/08 19:41:07 changed by mdawaffe

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?

(in reply to: ↑ 3 ) 03/24/08 19:45:55 changed by Viper007Bond

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.

03/28/08 18:17:51 changed by mdawaffe

  • keywords set to has-patch commit.

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.

03/28/08 18:18:15 changed by mdawaffe

  • attachment 6349.b.diff added.

03/28/08 18:38:49 changed by mdawaffe

  • attachment 6349.c.diff added.

03/28/08 18:40:03 changed by mdawaffe

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

03/28/08 19:30:12 changed by mdawaffe

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

03/29/08 18:47:22 changed by mdawaffe

  • milestone changed from 2.6 to 2.5.1.

04/17/08 20:36:36 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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

04/17/08 20:37:05 changed by ryan

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