prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
230 stars 127 forks source link

Prestashop productcomments has switched to returning JSON #216

Closed tswfi closed 3 years ago

tswfi commented 3 years ago

see: https://github.com/PrestaShop/productcomments/pull/81
especially this commit: https://github.com/PrestaShop/productcomments/pull/81/commits/9e019037c49e1288ddeb54783d56ffd14e7ec4ac

the override in classic-rocket tries to parse the already json format which fails with

Uncaught SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at Object.success (list-comments.js:56)
    at u (core.js:39)
    at Object.fireWith [as resolveWith] (core.js:39)
    at S (core.js:39)
    at XMLHttpRequest.<anonymous> (core.js:39)

there are few places in list-comments that try to parse the response: https://github.com/prestarocket-agence/classic-rocket/blob/646572802860b9fe49506f01c66af0d035cb916f/modules/productcomments/views/js/list-comments.js#L56

This probably needs to be fixed in a way that both the old and new format can be supported.

Culvanen commented 3 years ago

I have the same problem, how to solve it ?

tswfi commented 3 years ago

There is a pr, but it is still under review https://github.com/prestarocket-agence/classic-rocket/pull/220