skinordic Posted June 16, 2014 Share Posted June 16, 2014 Hi When trying to upload a miniture in a category i get the message: JSON.parse: unexpected character at line 1 column 1 of the JSON data How do i fix that Jesper Link to comment Share on other sites More sharing options...
skinordic Posted June 18, 2014 Author Share Posted June 18, 2014 Nobody have a solution ???? Link to comment Share on other sites More sharing options...
skinordic Posted June 22, 2014 Author Share Posted June 22, 2014 ok i must be the only one with this problem ?? Link to comment Share on other sites More sharing options...
skinordic Posted July 6, 2014 Author Share Posted July 6, 2014 Still nobody ?? www.rulleskisport.dk Link to comment Share on other sites More sharing options...
djatomix1 Posted July 11, 2014 Share Posted July 11, 2014 I have the same bug on my PS1608 upgrated. In localhost or ovh Link to comment Share on other sites More sharing options...
NemoPS Posted July 11, 2014 Share Posted July 11, 2014 Bring up the developer console, then try uploading an image and examine the ajax call (network tab). Post a screen of the response if possible Link to comment Share on other sites More sharing options...
skinordic Posted July 11, 2014 Author Share Posted July 11, 2014 How do i bring up the developer console on 1.6.0.8 Link to comment Share on other sites More sharing options...
NemoPS Posted July 12, 2014 Share Posted July 12, 2014 It's not a prestashop feature, but a browser's. Hit f12 on chrome for exmple, or firefox if you have firebug Link to comment Share on other sites More sharing options...
djatomix1 Posted July 16, 2014 Share Posted July 16, 2014 Firebug show me 500 Internal Server Error 923ms jquery-....min.js (ligne 4) Link to comment Share on other sites More sharing options...
NemoPS Posted July 16, 2014 Share Posted July 16, 2014 Hm, bad. It's worth investigating it further, what's the broken url? Link to comment Share on other sites More sharing options...
djatomix1 Posted July 16, 2014 Share Posted July 16, 2014 (edited) /index.php?controller=AdminProducts&ajax=1&id_product=2106&action=addProductImage&rand=1405499805673 http://www.mega-hertz.fr/megahertz/js/jquery/jquery-1.11.0.min.js Edited July 16, 2014 by djatomix1 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted July 16, 2014 Share Posted July 16, 2014 With error reporting enabled, can you examine the response tab for this ajax call? Link to comment Share on other sites More sharing options...
djatomix1 Posted July 16, 2014 Share Posted July 16, 2014 I Don't know how to show ajax call... It's Network - XHR clic on + and POST show me Source -----------------------------1963530167660 Content-Disposition: form-data; name="legend[1]" P5000S -----------------------------1963530167660 Content-Disposition: form-data; name="file[]"; filename="5128-home_default.jpg" Content-Type: image/jpeg ÿØÿàJFIFÿþ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ÿÛC ÿÛC ÿÂ"ÿÄ ÿÄÿÚú¤àO· Link to comment Share on other sites More sharing options...
djatomix1 Posted July 16, 2014 Share Posted July 16, 2014 I read aggain the topic, I have the same bug when i add picture of product in Back office 1 Link to comment Share on other sites More sharing options...
djatomix1 Posted July 17, 2014 Share Posted July 17, 2014 I replace all classes with a new PS1608 and it's good, no bug this morning! Link to comment Share on other sites More sharing options...
mesflacons Posted August 1, 2014 Share Posted August 1, 2014 if it can help : I got this issue "JSON.parse: unexpected character at line 1 column 1 of the JSON data" when trying to import a csv file. After some times it seems that it happens because I was no longer connected to prestashop admin. 2 Link to comment Share on other sites More sharing options...
surflibre Posted August 21, 2014 Share Posted August 21, 2014 Hi When trying to upload a miniture in a category i get the message: JSON.parse: unexpected character at line 1 column 1 of the JSON data How do i fix that Jesper Hi, It comes from the "categories' block", reinstall it ... regards 1 Link to comment Share on other sites More sharing options...
skinordic Posted August 21, 2014 Author Share Posted August 21, 2014 Hi I have tried and i doesnt work Jesper Link to comment Share on other sites More sharing options...
skinordic Posted September 12, 2014 Author Share Posted September 12, 2014 NOBODY ?? strange that i am the only one with this problem Link to comment Share on other sites More sharing options...
Maura_NA Posted September 12, 2014 Share Posted September 12, 2014 Hi Skinordic, i had this problem too. But for me it was the problem that mesflacons explained, i was no longer connected to my backend as admin.Have you checked if you're still logged in? Sorry for my English. 1 Link to comment Share on other sites More sharing options...
CJH Posted September 17, 2014 Share Posted September 17, 2014 (edited) I also have this message appear when trying to add a jpg to a Category; can't find a fix or any way to upload the file (the file is good, it is selectable to upload, but the error appears when trying to upload). Using v1.6.0.6. Upload fails using either format of png or jpg. This appears to only affect the Category image upload - I can create a new product and add photos to that - I can also add the same file to a Product that will not upload as a Category image. Anyone any ideas what to try? Update: the above occurs in Firefox. Using Internet Explorer uploads still fail, but with the error 'invalid character'. Edited September 17, 2014 by CJH (see edit history) Link to comment Share on other sites More sharing options...
invpts3 Posted October 7, 2014 Share Posted October 7, 2014 I have this problem too when uploading an image to a product. The .jpg-file is succesfully uploaded but it gives this same error. Version 1.6.0.9 Template EDA - Novaworks Link to comment Share on other sites More sharing options...
invpts3 Posted October 15, 2014 Share Posted October 15, 2014 I have more image-errors. Also when uploading an image for the slider or a category. Practically every upload gives an error, but the image is always uploaded. Attached the additional error when uploading a slider image. This error also shows up switching between pages within the admin. For example being at the productpage and going to the categoriespage. I'm not sure if there is a relation between the JSON error: JSON.parse: unexpected character at line 1 column 1 of the JSON data Link to comment Share on other sites More sharing options...
NemoPS Posted October 15, 2014 Share Posted October 15, 2014 You are using a broken override, check the original method, then the overridden one mentioned in the error, and have them match 1 Link to comment Share on other sites More sharing options...
invpts3 Posted October 15, 2014 Share Posted October 15, 2014 Ok thanks! Found this in the original public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false, &$error = 0) The override was missing the &$error = 0) Thanks! Link to comment Share on other sites More sharing options...
delfin Posted November 14, 2014 Share Posted November 14, 2014 Hm, bad. It's worth investigating it further, what's the broken url? En la consola sale este mensaje Link to comment Share on other sites More sharing options...
delfin Posted November 14, 2014 Share Posted November 14, 2014 Bring up the developer console, then try uploading an image and examine the ajax call (network tab). Post a screen of the response if possible No se como hacer que tengo que cambiar me puedes ayudar? Link to comment Share on other sites More sharing options...
NemoPS Posted November 14, 2014 Share Posted November 14, 2014 That means jQuery is not working for some reason. Please stick to english as we're on the english board It's weird thought, there is nothing at line 75, it might be referring to the 79 one. Are you using a custom template? Link to comment Share on other sites More sharing options...
kratek Posted November 28, 2014 Share Posted November 28, 2014 How to fix this problem? Link to comment Share on other sites More sharing options...
NemoPS Posted November 29, 2014 Share Posted November 29, 2014 This, which one? broken jquery? Link to comment Share on other sites More sharing options...
iAreku Posted December 31, 2014 Share Posted December 31, 2014 Im having the same error when I try to update a product quantity to -1, while others are correctly updated to -1 or even -100 (internal purposes)... Any cl ues? Thanks! Link to comment Share on other sites More sharing options...
K D S Posted January 9, 2015 Share Posted January 9, 2015 Im having the same error when I try to update a product quantity to -1, while others are correctly updated to -1 or even -100 (internal purposes)... Any cl ues? Thanks! I had same problem now, I had fix it by deleting existing files (olds files uploaded) with FTP. Link to comment Share on other sites More sharing options...
NemoPS Posted January 10, 2015 Share Posted January 10, 2015 @iAreku: does that product have anything different compared to the ones that work? Link to comment Share on other sites More sharing options...
iAreku Posted January 10, 2015 Share Posted January 10, 2015 I'd more of say its sort of random behaviour, which is even more "p*ssing".... @kemdres wdy mean deleting existing files? what files? Link to comment Share on other sites More sharing options...
K D S Posted January 10, 2015 Share Posted January 10, 2015 (edited) I'd more of say its sort of random behaviour, which is even more "p*ssing".... @kemdres wdy mean deleting existing files? what files? I removed the *.csv import files in the admin/import/ I left only index.php and .htaccess files in the folder but my problem was not the same of you, the error "JSON.parse: unexpected character at line 1", appear when I try to upload import file *.csv in "Imports CSV" Edited January 10, 2015 by kemdres (see edit history) Link to comment Share on other sites More sharing options...
xiparos Posted January 22, 2015 Share Posted January 22, 2015 I removed the *.csv import files in the admin/import/ I left only index.php and .htaccess files in the folder but my problem was not the same of you, the error "JSON.parse: unexpected character at line 1", appear when I try to upload import file *.csv in "Imports CSV" As mesflacons indicated, you got this error 'cause the admin account has logged out when you tried to import a csv file. same error when testing with 1.6.0.11, then I logged in, no more error spawns csv file has been successfully uploaded. Link to comment Share on other sites More sharing options...
peter4661 Posted January 23, 2015 Share Posted January 23, 2015 After update from version 1.6.0.9 to 1.6.0.11 we do get two type JSON.parse error warnings with updating product quantity ( see screencast capture below). Error warning comes with all product tested. Regardless positive or negative product quantity. Product quantity is updated correctly. We are on default theme. We don't know the impact of the warning ( could not find related anything simular on the forum ) Advice is welcome, Peter Our URL www.derks-wielersport.nl http://screencast.com/t/EbpFCDxUdj http://screencast.com/t/noQxSOoaCsF Link to comment Share on other sites More sharing options...
NemoPS Posted January 24, 2015 Share Posted January 24, 2015 It seems you're getting the beginning of an html tag in the json response. Open up the debug console and tab to Network, inspect the call you get the json error out of Link to comment Share on other sites More sharing options...
PMaster Posted February 4, 2015 Share Posted February 4, 2015 Hi When trying to upload a miniture in a category i get the message: JSON.parse: unexpected character at line 1 column 1 of the JSON data How do i fix that Jesper Uninstall and install the module "BLOCKCATEGORIES" and you will be ok Link to comment Share on other sites More sharing options...
IgorSB Posted June 16, 2015 Share Posted June 16, 2015 What is your image extension... .JPG or .jpg. I was have problem with image extension. Error was "JSON.parse: unexpected character at line 1 column 1 of the JSON data" and I just change .JPG to .jpg and problem have been solved. Link to comment Share on other sites More sharing options...
iAreku Posted June 16, 2015 Share Posted June 16, 2015 On my end it has no relation with images, as this happens straight on creating a new product. Ie. add a new product thru the BO, then try to update its quANTity and i get the damn Json error. Then i must edit it again, update the field twice, then it will save. makes no sense! Link to comment Share on other sites More sharing options...
valentin.g Posted July 30, 2015 Share Posted July 30, 2015 this issue appear because your watermark image is not GIF. modules - watermark - configure and add gif version Link to comment Share on other sites More sharing options...
d_perstasop Posted August 10, 2015 Share Posted August 10, 2015 I've just fixed it. Something so simple as clearing cache and cookies. If you try it once again, it's possible It will work. Good luck. Link to comment Share on other sites More sharing options...
ITIS-Commerce.com Posted November 10, 2015 Share Posted November 10, 2015 Bonjour, Nous avions le même souci lors de l'upload de photos supplémentaires sur les fiches produits.Nous l'avons corrigé avec cette requête : ALTER TABLE `ps_image` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; ALTER TABLE `ps_image_shop` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; Bonne journée Hello, We had the same issue when uplaoding multiple images to a product. We solved it with this upadte on the database : ALTER TABLE `ps_image` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; ALTER TABLE `ps_image_shop` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; Regards, Link to comment Share on other sites More sharing options...
Vali Iacobescu Posted February 25, 2016 Share Posted February 25, 2016 I have this error, too. It's happens when I try do add an image to any product. This is what I get in developer console: Warning: Wrong parameter count for clearstatcache() in /home/janetnai/public_html/classes/Uploader.php on line 274 {"file":[{"tmp_name":"\/tmp\/phpIxkMCJ","name":"logo-janetnails-site-sm-phone.png","size":11018,"type":"image\/png","error":0,"status":"ok","id":"2762","position":3,"cover":0,"legend":null,"path":"2\/7\/6\/2\/2762","shops":{"1":true[spam-filter]]} Please help! Link to comment Share on other sites More sharing options...
valentin.g Posted February 25, 2016 Share Posted February 25, 2016 hi Vali, You need to configure module watermark and upload there a watermark in GIF format. Give a try. Your issue is occurs when Prestashop try to add watermark to your product image. Link to comment Share on other sites More sharing options...
Vali Iacobescu Posted February 26, 2016 Share Posted February 26, 2016 I don't understand, Valentin.g. Watermark module is not even installed. Could you give me more details, please? I have to mention that prestashop version is 1.6.0.14. and I didn't make any updates. Thanks! Link to comment Share on other sites More sharing options...
valentin.g Posted February 26, 2016 Share Posted February 26, 2016 I think is not your case. No idea what else. Need to check live to find problem. Link to comment Share on other sites More sharing options...
NemoPS Posted February 26, 2016 Share Posted February 26, 2016 Try to edit that function call at like 274just change thisclearstatcache(true, $file_path); to clearstatcache(); 1 1 Link to comment Share on other sites More sharing options...
Vali Iacobescu Posted March 1, 2016 Share Posted March 1, 2016 It worked. Thank you very much, Nemo. Link to comment Share on other sites More sharing options...
SoniCoder Posted June 9, 2016 Share Posted June 9, 2016 In my case the problem is when I upload a picture Just with big ones of more than 0.8mb in the 1.6.1.5 It have to be related with the max limit upload of your host or something Link to comment Share on other sites More sharing options...
AdomasMat Posted January 22, 2017 Share Posted January 22, 2017 Hi, having the same problem while uploading a picture to my product. Was able to upload a picture of 2.04 mb, but a one with 2.40 isn`t coming through. Though the limit is 8 mb... can understand the nature of the problem and it just blows my mind. Just started a shop and wouldn`t want to ditch Prestashop at the very beginning... Please help Link to comment Share on other sites More sharing options...
NemoPS Posted January 23, 2017 Share Posted January 23, 2017 Are you sure the real limit is 8mb? Also, it might be timing out, is it slow uploading it? Link to comment Share on other sites More sharing options...
PetitEtreMalfaisant Posted February 6, 2017 Share Posted February 6, 2017 (edited) With Prestashop 1.6.0.14, I have the same error message while uploading the 1st image. But the cause seems to be different : <div class="alert alert-danger"> <button type="button" class="close" data-dismiss="alert">×</button> Duplicate entry '257-1' for key 'id_product_cover'<br /><br /> <pre>INSERT INTO `ps_image` (`id_product`, `position`, `cover`) VALUES ('257', '2', '1')</pre> </div> In the end, the picture is not uploaded and there is a line in the table ps_image : id_product = 257,position = 1, cover = 1 It's like prestashop tries to insert twice in the table. I already executed : ALTER TABLE `ps_image` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; ALTER TABLE `ps_image_shop` CHANGE `cover` `cover` TINYINT(1) UNSIGNED NULL DEFAULT '0'; but it doesn't solve the problem. Any idea? Thanks Edited February 6, 2017 by PetitEtreMalfaisant (see edit history) Link to comment Share on other sites More sharing options...
parilla77 Posted March 1, 2017 Share Posted March 1, 2017 (edited) Hello, I've the same problem when I put the first product in the cart on the FO : Impossible to add the product to the cart.<br/>textStatus: 'parsererror'<br/>errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data'<br/>responseText:<br/><pre>Array ( [0] => Array ( [file] => /var/www/prestashop/classes/Cart.php [line] => 950 [function] => displayError [class] => ToolsCore [type] => :: [args] => Array ( ) ) [1] => Array ( [file] => /var/www/prestashop/classes/Cart.php [line] => 872 [function] => updateQty [class] => CartCore [object] => Cart Object ( .......... When I click again to add a product in the cart, that work and the first product appear in the cart also, it's the same thing when i xant to remove it from the cart. Could you help me please ? EDIT : SOLVED IT WAS DUE TO A BAD CART RULE ... Thanks Romain Edited March 1, 2017 by parilla77 (see edit history) Link to comment Share on other sites More sharing options...
lukyluke Posted March 9, 2017 Share Posted March 9, 2017 NOBODY ?? strange that i am the only one with this problem i had this problem when i uploaded image from product, i disconnect and reconnect at backoffice, it work fine now. Link to comment Share on other sites More sharing options...
Recommended Posts