[wp-trac] [WordPress Trac] #35101: image_default_link_type option not being respected

WordPress Trac noreply at wordpress.org
Tue Dec 22 16:13:23 UTC 2015


#35101: image_default_link_type option not being respected
-------------------------------------+-----------------------------
 Reporter:  ben1390                  |       Owner:  wonderboymusic
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.4.1
Component:  Media                    |     Version:  4.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+-----------------------------
Changes (by eherman24):

 * keywords:  needs-patch => has-patch needs-testing


Comment:

 After some additional testing, and reading through @wetapplemedia
 breakdown of the issue, I was able to reproduce this issue.

 It seems that after you change the value of one of the drop downs, the
 users settings were updated for the three respective fields, in utils.js:
 'align', 'urlbutton' and 'imgsize'.

 https://github.com/WordPress/WordPress/blob/77e365efbf2e499e2ed11d29c101ea466cf1ceed
 /wp-includes/js/utils.js#L177

 Once stored in the user settings, they were being referenced on each open
 of the media library to reset the values back to the original state - but
 instead of referencing the global site options they were being referenced
 from the backbone model. This was happening in media-views.js.

 https://github.com/WordPress/WordPress/blob/77e365efbf2e499e2ed11d29c101ea466cf1ceed
 /wp-includes/js/media-views.js#L1181-L1189

 I've attached a patch that removes referencing those three options from
 the Backbone model and instead references them from the defaultProps
 variable.

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


More information about the wp-trac mailing list