MAR 10 2017

Magento :: SyntaxError: expected expression, got ‘,’

Problem description

Image upload is broken in Magento after upgrade to 1.9.3 or SUPEE-8788 patch. The following error is logged in browser console:
SyntaxError: expected expression, got ','
In HTML source code you can see that one element is missing in media_gallery_contentJsObject variable:
var media_gallery_contentJsObject = new Product.Gallery('media_gallery_content', , {"thumbnail":{"label":"Thumbnail ","field":"product[thumbnail]"},"small_image":{"label":"Small Image ","field":"product[small_image]"},"image":{"label":"Base Image ","field":"product[image]"}});


The problem is caused by Creare/CreareSEO extension that override image uploader code.


Update app/design/adminhtml/default/default/template/creareseo/catalog/product/helper/gallery.phtml file with the following change:
--- app/design/adminhtml/default/default/template/creareseo/catalog/product/helper/gallery.phtml
+++ app/design/adminhtml/default/default/template/creareseo/catalog/product/helper/gallery.phtml
@@ -96,3 +96,3 @@
-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() ?>);
+var <?php echo $_block->getJsObjectName(); ?> = new Product.Gallery('<?php echo $_block->getHtmlId() ?>', <?php echo $_block->getImageTypesJson() ?>);
or re-upload it from

Posted in: Extensions, Troubleshooting

Magento :: SyntaxError: expected expression, got ‘,’
0 votes, 0.00 avg. rating (0% score)