Magento 1.7.0.2 Admin Editor – “Opener is null” Issue with Inserting Images/Files in wysiwug editor shown error in browser.js

While using wysiwug editor to insert the media image , its givs an error in browser.js thus resulting not uploading the images.
This can be overcome by comment the line below in browser.js on line number staring form 228

getTargetElement: function() {
    if (typeof(tinyMCE) != 'undefined' && tinyMCE.get(this.targetElementId)) {
        if ((opener = this.getMediaBrowserOpener())) {
            var targetElementId = tinyMceEditors.get(this.targetElementId).getMediaBrowserTargetElementId();
            return opener.document.getElementById(targetElementId);
        } else {
            return null;
        }
    } else {
        return document.getElementById(this.targetElementId);
    }
},

Replace the above line withe the line below

getTargetElement: function() {
    if (typeof(tinyMCE) != 'undefined' && tinyMCE.get(this.targetElementId)) {
        if ((notOpener = this.getMediaBrowserOpener())) {
            var targetElementId = tinyMceEditors.get(this.targetElementId).getMediaBrowserTargetElementId();
            return notOpener.document.getElementById(targetElementId);
        } else {
            return null;
        }
    } else {
        return document.getElementById(this.targetElementId);
    }
},

After changing the above line uploading the image works in wysiwug editor

Source : http://www.fortwaynewebdevelopment.com/magento-admin-editor-opener-null-issue-inserting-imagesfiles/

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: