[wp-trac] [WordPress Trac] #36749: Customizer wont load: issue with site-icon control

WordPress Trac noreply at wordpress.org
Thu May 12 07:31:48 UTC 2016


#36749: Customizer wont load: issue with site-icon control
---------------------------------------+-------------------------
 Reporter:  raxcido                    |       Owner:
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  4.5.3
Component:  Customize                  |     Version:  4.5
 Severity:  normal                     |  Resolution:
 Keywords:  needs-patch needs-testing  |     Focuses:  javascript
---------------------------------------+-------------------------
Changes (by swissspidy):

 * keywords:   => needs-patch needs-testing


Comment:

 So currently it looks like this:

 {{{
 <# if ( data.attachment && data.attachment.id ) { #>
 }}}

 Proposed fix 1:

 {{{
 <# if ( data.attachment && data.attachment.id && data.attachment.sizes) {
 #>
 }}}

 Proposed fix 2 from #36820:

 {{{
 <# data.attachment.sizes = data.attachment.sizes || { 'full': { 'url':
 data.attachment.url } } #>
 <# if ( data.attachment && data.attachment.id ) { #>
 }}}

 Though I like the former approach more, I could not reproduce this issue
 on a fresh 4.5 site ''at all''.

 What would cause an image to not have a sizes property?

 According to `wp_prepare_attachment_for_js()` this would happen in two
 cases:

 1. The attachment is not an image
 2. The attachment has no meta data, i.e `wp_get_attachment_metadata()`
 returns false

 I can't add non-image attachments as site icons though…

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


More information about the wp-trac mailing list