文档 下载安装 商店 博客 问答 主机

Magento某个产品图片不显示,并且控制台报错.

bug

#1

报错信息类似于:

Uncaught SyntaxError: Unexpected token B in JSON at position 139
at JSON.parse (<anonymous>)
at getData (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:60:24)
at Array.map (<anonymous>)
at HTMLDocument.apply (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:76:18)
at fire (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:3234:32)
at Object.add [as done] (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:3293:8)
at jQuery.fn.init.jQuery.fn.ready (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:3544:26)
at jQuery.fn.init (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:2969:11)
at new jQuery.fn.init (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:227:17)
at jQuery (eval at require.load (943649b5edf1d71f794cee1e7a489844.js:2376), <anonymous>:77:11)

原因

这是Magento已知的一个bug,是因为在产品名中有双引号。

解决办法

移除双引号,或更新Magento至最新的版本.