5

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.

  • Is JS/CSS files merge enabled in admin? – DmitryR Feb 23 '17 at 14:37
  • It's disabled (another fix I've tried, forgot to add it to the list above). – James Seddon Feb 23 '17 at 14:54
  • which browser do you using? – Prasanta Hatui Feb 23 '17 at 14:56
  • Tried in Safari & Chrome on Mac. Sorry, added specs to top of post... – James Seddon Feb 23 '17 at 14:59
0

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.