Make WordPress Core

Ticket #43139: 43139.patch

File 43139.patch, 872 bytes (added by janak007, 7 years ago)

I have added a patch to fix this issue. I have eliminated media item id which is causing issue.

  • src/wp-includes/widgets/class-wp-widget-media-gallery.php

     
    174174                <script type="text/html" id="tmpl-wp-media-widget-gallery-preview">
    175175                        <# var describedById = 'describedBy-' + String( Math.random() ); #>
    176176                        <# if ( data.ids.length ) { #>
     177                                <# var AttachIds = []; #>
     178                                <# _.each( data.ids, function( id, index ) { #>
     179                                        <#
     180                                        var attachment = data.attachments[ id ];
     181                                        if ( attachment ) {
     182                                                AttachIds.push(id);
     183                                        }
     184                                        #>
     185                                <# } ); #>
     186                                <# data.ids = AttachIds; #>
    177187                                <div class="gallery media-widget-gallery-preview">
    178188                                        <# _.each( data.ids, function( id, index ) { #>
    179189                                                <#