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.

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

2 Answers 2

1

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

I was having the same issue after migrating from Magento 1 to OpenMage.

In Magento 1, images are showing without any issues, but when switching to OpenMage with PHP8, the media gallery was not loading.

I have followed many blogs but couldn't get the result.

What I did

  1. Removed all third-party modules (moved all module xml files to a new subdirectory).
  2. Renamed the custom theme directory so that the default theme can be loaded.
  3. Have renamed app/code/local directory to check if any custom code exists for core files.
  4. Now that the gallery images are visible, change the original name to app/code/local/ and reduce the area by renaming each subdirectory where the issue exists one by one.
  5. Finally, I found that there was a condition for count() that I needed to update.
  6. And, finally, after 2-3 days, it was working for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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