Magento – All product images missing from admin but show in DB and front end

adminjavascriptmagento-1.9mediaproduct-images

Using Magento v1.9.2.2 with patches SUPEE-7405 v1, SUPEE-7405 v1.1, SUPEE-8788, SUPEE-9652. Browsers: Safari & Chrome on Mac OSX.

I'm having an issue where none of the images in the product admin are displaying for some reason. It's not just images uploaded since any of the patches have been applied, it's all images, ever uploaded (see image for example).

Images in admin missing

All the images are still in the media folder, they still exist in the database and they still show up on the frontend.

I've tried various fixes but nothing seems to be coming up trumps, including:

When inspecting the code in the admin panel I'm getting an "Unexpected Token ','" error in the media_gallery_contentJsObject script

//<![CDATA[var media_gallery_contentJsObject = new Product.Gallery('media_gallery_content', , {"cover_image":{"label":"Cover Image ","field":"product[cover_image]"},"image":{"label":"Base Image ","field":"product[image]"},"small_image":{"label":"Small Image ","field":"product[small_image]"},"thumbnail":{"label":"Thumbnail ","field":"product[thumbnail]"}});//]]>

Where just after 'media_gallery_content' there is a piece missing.

Comparing this to another store it would appear to be something along the lines of id_69c186495899f5764a731df5baafee05_UploaderJsObject that is missing.

Any ideas how to resolve this would be greatly appreciated.

Best Answer

Go to path

app/design/adminhtml/default/indent/template/catalog/product/helper/gallery.phtml

Comment Script

<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>

Add Script

<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 if ($_block->getUploader()->getJsObjectName()):?><?php echo $_block->getUploader()->getJsObjectName() ?>,<?php endif;?><?php endif;?> <?php echo $_block->getImageTypesJson() ?>);
//]]>
</script>