Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#31558 closed defect (bug) (fixed)

Edit post: tags meta box - "Choose from the most used tags" displays the result twice

Reported by: tyxla's profile tyxla Owned by: azaozz's profile azaozz
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Posts, Post Types Keywords: has-patch
Focuses: javascript, administration Cc:

Description

In the Edit Post screen, in the Tags meta box, when the Choose from the most used tags link is clicked, this results in displaying a duplicate result. This is either a No tags found. message, or a list of the most used tags - but in both cases it is wrongly displayed twice.

Attachments (1)

31558.patch (744 bytes) - added by tyxla 10 years ago.
Removing tagBox init frrom tags-box.js and moving it into the render() of press-this.js

Download all attachments as: .zip

Change History (7)

#1 @tyxla
10 years ago

  • Keywords needs-patch added

Related: #31373

@tyxla
10 years ago

Removing tagBox init frrom tags-box.js and moving it into the render() of press-this.js

#2 @tyxla
10 years ago

  • Keywords has-patch added; needs-patch removed

I've investigated the issue and discovered that it was introduced in 31534, when wp-admin/js/tags-box.js was created and abstracted from wp-admin/js/post.js.

Basically, the tagBox needed to be initialized for Press This, and for some reason it was changed to be initialized in tags-box.js itself. But the tagBox is also initialized in wp-admin/js/post.js, which causes all functionality and event handlers to be called twice. As a result, clicking that link would append the "No tags found." message or list of most used tags twice.

So in order to fix the issue, I've removed the tagBox initialization from wp-admin/js/tags-box.js and added it to the render function of Press This in wp-admin/js/press-this.js.

#3 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.2

#4 @DrewAPicture
10 years ago

  • Priority changed from normal to high

#5 @azaozz
10 years ago

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

In 31675:

Fix tagBox init on the Edit Post screen. Props tyxla. Fixes #31558.

#6 @DrewAPicture
10 years ago

  • Priority changed from high to normal
Note: See TracTickets for help on using tickets.