Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento UploaderJsObject is not defined

I encountered a very weird error which i can't seem to solve. Anywhere in the admin area where i want to upload/view/delete images nothing is showing up.

My 'inspect element' console gives me this error:

Uncaught ReferenceError: id_23b2a41c446dee70b327b51065e06137_UploaderJsObject is not defined 

I tracked this down to the gallery.phtml file which has this code:

<script type="text/javascript">
//<![CDATA[
    var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo         $_block->getHtmlId() ?>', <?php if ($_block->getElement()->getReadonly()):?>null<?php     else:?><?php echo $_block->getUploader()->getJsObjectName() ?><?php endif;?>, <?php echo $_block->getImageTypesJson() ?>);
//]]>
</script>

I have absolutely no clue what went wrong here. I haven't messes with any core files. Nor did i change any javascript things.

I'm hoping someone can help me find out what is wrong. Been stuck on this error since yesterday..

Any help is appreciated :)

like image 802
Wesley Smits Avatar asked Oct 23 '12 12:10

Wesley Smits


1 Answers

Recently cloned a repo or trying to set up another magento environment and seeing this error? check to see if the following files are in their proper places that may have been left behind due to being binary file (swf flash file) or ignored by version control software:

/skin/adminhtml/default/default/media/uploader.swf
/skin/adminhtml/default/default/media/uploaderSingle.swf
/skin/adminhtml/default/default/media/editor.swf
/skin/adminhtml/default/default/media/flex.swf

and for good measure these files:

/app/design/adminhtml/default/default/template/media/uploader.phtml
/app/design/adminhtml/default/default/template/media/editor.phtml

And someone below was kind to mention as of magento 1.9:

/skin/adminhtml/default/default/media/editor.swf

does not exist, so don't worry about that file.

like image 200
Danny Z Avatar answered Oct 14 '22 09:10

Danny Z