Search code examples
magentomagento-1.9patch

BUG - after SUPEE-8788 i can't remove Samples row of downloadable products


i'm using magento 1.9.2.4 patched with SUPEE-8788.

Everything seems to be ok a part an issue, ...i'm not able anymore to remove rows in samples

of downloadable products.

I mean when i click the "X" to remove the row of samples, like you can see in the image, nothing happen and i'm not able to save the product image here

I saw the same problem happens also in a fresh clean copy of magento 1.9.3.1

Does anyone know why this happens?...can you help me?

Thank you very much


Solution

  • I found the solution, this is a bug in SUPEE-8788

    Open samples.phtml inside app/design/adminhtml/default/default/template/downloadable/product/edit/downloadable

    Find the function

    remove : function(event){
        var element = $(Event.findElement(event, 'tr'));
        alertAlreadyDisplayed = false;
        if(element){
            element.down('input[type="hidden"].__delete__').value = '1';
            element.down('div.flex').remove();
            element.addClassName('no-display');
            element.addClassName('ignore-validate');
            element.hide();
        }
    },
    

    and replace it with

    remove : function(event){
        var element = $(Event.findElement(event, 'tr'));
        alertAlreadyDisplayed = false;
        if(element){
            element.down('input[type="hidden"].__delete__').value = '1';
            Element.select(element, 'div.flex').each(function(elm){
                elm.remove();
            });
            element.addClassName('no-display');
            element.addClassName('ignore-validate');
            element.hide();
        }
    },
    

    I hope you will solve the problem