[wp-trac] [WordPress Trac] #31558: Edit post: tags meta box - "Choose from the most used tags" displays the result twice

WordPress Trac noreply at wordpress.org
Sat Mar 7 20:34:26 UTC 2015


#31558: Edit post: tags meta box - "Choose from the most used tags" displays the
result twice
-------------------------------+-----------------------------------------
 Reporter:  tyxla              |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:  javascript, administration
-------------------------------+-----------------------------------------
Changes (by tyxla):

 * keywords:  needs-patch => has-patch


Comment:

 I've investigated the issue and discovered that it was introduced in
 [changeset: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`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31558#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list