• Resolved tytho

    (@tytho)


    I’m trying to use your plugin, but the front-end stuff won’t work due to a JSON parsing error.

    On line 109 of assets/js/frontend.js you have the following:

    var useCustomStarImages = jQuery.parseJSON(mr_frontend_data.use_custom_star_images);

    The mr_frontend_data.use_custom_star_images is an empty string, and it throws a very useless error Unexpected end of input.

    The reason it gets an empty string is because on line 437 of multi-rating.php, you’re getting the setting with 'use_custom_star_images' => $style_settings[Multi_Rating::USE_CUSTOM_STAR_IMAGES]

    If you switch it to 'use_custom_star_images' => $style_settings[Multi_Rating::USE_CUSTOM_STAR_IMAGES] ? 'true' : 'false' so that it actually outputs ‘true’ or ‘false’, then the JSON parsing stuff won’t break.

    https://www.ads-software.com/plugins/multi-rating/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dpowney

    (@dpowney)

    Hi Tytho,

    Thanks for pointing this out. Will be available in next version.

    Thanks,
    Daniel

    Plugin Author dpowney

    (@dpowney)

    This is available in version 4.0 available now. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JSON parse error’ is closed to new replies.