#31558 closed defect (bug) (fixed)
Edit post: tags meta box - "Choose from the most used tags" displays the result twice
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
Change History (7)
@
11 years ago
Removing tagBox init frrom tags-box.js and moving it into the render() of press-this.js
#2
@
11 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.
Related: #31373