{"id":635,"date":"2020-07-27T14:13:28","date_gmt":"2020-07-27T13:13:28","guid":{"rendered":"https:\/\/www.graphicz.co.uk\/blog\/?p=635"},"modified":"2020-07-27T14:13:30","modified_gmt":"2020-07-27T13:13:30","slug":"the-filter-operation-in-sellerdeck-returned-a-script-error-the-error-was-syntaxerror-parsejson","status":"publish","type":"post","link":"https:\/\/www.graphicz.co.uk\/blog\/the-filter-operation-in-sellerdeck-returned-a-script-error-the-error-was-syntaxerror-parsejson\/","title":{"rendered":"The filter operation in Sellerdeck returned a script error. The error was: [SyntaxError: parseJSON]"},"content":{"rendered":"\n<p>In a Swift site when searching for some but not all search terms an error was generated:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>The filter operation returned a script error. Please try again, and contact us if the error persists. The error was: [SyntaxError: parseJSON]<\/strong><\/pre>\n\n\n\n<p>This error persisted despite applying the fixes at:<br><a rel=\"noreferrer noopener\" href=\"https:\/\/community.sellerdeck.com\/forum\/knowledge-base\/online-store-issues\/56090-the-filter-operation-returned-a-script-error-the-error-was-syntaxerror-parsejson\" target=\"_blank\">https:\/\/community.sellerdeck.com\/for&#8230;rror-parsejson<\/a><br>and<br><a rel=\"noreferrer noopener\" href=\"https:\/\/community.sellerdeck.com\/forum\/discussion-areas\/bug-reports\/57242-parse-json-error-if-filtered-descriptions-have-embbeded-html-containing-quotes\" target=\"_blank\">https:\/\/community.sellerdeck.com\/for&#8230;taining-quotes<\/a><br><br>Sellerdeck Development have kindly come up with a solution:<br><br>Please go to the current site folder and take a backup copy of &#8216;SearchScript.pl&#8217;<br><br>Open the script in a plain text editor and find the following lines of code::<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">my $nResultCount = scalar (@arrProductFields);\nmy $sResults = join ('\",\"', @arrProductFields);<\/pre>\n\n\n\n<p>and replace it with::<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">my $nResultCount = scalar (@arrProductFields);\nfor (@arrProductFields)\n{ s\/\"\/\\\\\"\/g; }\n\nmy $sResults = join ('\",\"', @arrProductFields);<\/pre>\n\n\n\n<p>Save the changes and upload the site<\/p>\n\n\n\n<p>This resolve the issue that <a href=\"https:\/\/community.sellerdeck.com\/forum\/discussion-areas\/bug-reports\/57242-parse-json-error-if-filtered-descriptions-have-embbeded-html-containing-quotes\" target=\"_blank\" rel=\"noreferrer noopener\">Norman noted<\/a>, but the <a href=\"https:\/\/community.sellerdeck.com\/forum\/knowledge-base\/online-store-issues\/56090-the-filter-operation-returned-a-script-error-the-error-was-syntaxerror-parsejson\" target=\"_blank\" rel=\"noreferrer noopener\">other issue is with regard to caching. I think this deals with another issue, sadly the &#8216; SyntaxError: parseJSON&#8217; error is a catchall<\/a>.<br><br>Thanks and acknowledgements to Gary Green and Sellerdeck Developers<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a Swift site when searching for some but not all search terms an error was generated: The filter operation returned a script error. Please try again, and contact us if the error persists. The error was: [SyntaxError: parseJSON] This<span class=\"ellipsis\">&hellip;<\/span> <a href=\"https:\/\/www.graphicz.co.uk\/blog\/the-filter-operation-in-sellerdeck-returned-a-script-error-the-error-was-syntaxerror-parsejson\/\"><\/p>\n<div class=\"read-more\"><b>Read more &#8250;<\/b><\/div>\n<p><!-- end of .read-more --><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-635","post","type-post","status-publish","format-standard","hentry","category-graphicz-articles"],"_links":{"self":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/635"}],"collection":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=635"}],"version-history":[{"count":1,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/635\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/635\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}