Make WordPress Core

Ticket #62788: 62788-new.patch

File 62788-new.patch, 1.7 KB (added by vrishabhsk, 12 months ago)

Latest Patch with the required changes

  • src/js/_enqueues/wp/updates.js

    diff --git a/src/js/_enqueues/wp/updates.js b/src/js/_enqueues/wp/updates.js
    index aca73fdd4f..d3abf1e919 100644
    a b  
    14881488         * @param {string}  response.errorMessage The error that occurred.
    14891489         */
    14901490        wp.updates.deletePluginError = function( response ) {
    1491                 var $plugin, $pluginUpdateRow,
     1491                var $plugin, $pluginUpdateRow, $pluginDataSlug,
    14921492                        pluginUpdateRow  = wp.template( 'item-update-row' ),
    14931493                        noticeContent    = wp.updates.adminNotice( {
    14941494                                className: 'update-message notice-error notice-alt',
    14951495                                message:   response.errorMessage
    14961496                        } );
    1497 
     1497               
    14981498                if ( response.plugin ) {
    14991499                        $plugin          = $( 'tr.inactive[data-plugin="' + response.plugin + '"]' );
    1500                         $pluginUpdateRow = $plugin.siblings( '[data-plugin="' + response.plugin + '"]' );
     1500                        $pluginUpdateRow = $plugin.siblings('[data-plugin="' + response.plugin + '"]');
     1501                        $pluginDataSlug  = response.plugin;
     1502
    15011503                } else {
    15021504                        $plugin          = $( 'tr.inactive[data-slug="' + response.slug + '"]' );
    15031505                        $pluginUpdateRow = $plugin.siblings( '[data-slug="' + response.slug + '"]' );
     1506                        $pluginDataSlug  = response.slug;
     1507                }
     1508
     1509                if ( $pluginDataSlug ) {
     1510                        $link = $('[data-slug="' + $pluginDataSlug + '"]').find('.row-actions a.delete');
     1511                        $link.text( $link.data( 'originaltext' ) );
     1512                } else {
     1513                        // As a fallback, find the elements with text as "deleting..." and reset it to the original text
     1514                        $('[data-slug]').find('.row-actions a.delete').each(function() {
     1515                                if ( $(this).text() === __( 'Deleting...' ) ) {
     1516                                        $(this).text( $(this).data( 'originaltext' ) );
     1517                                }
     1518                        });
    15041519                }
    15051520
    15061521                if ( ! wp.updates.isValidResponse( response, 'delete' ) ) {