Jump to content

image doesnt save


rst
 Share

Recommended Posts

Hello,

I have repeater field with an image field as one of its fields. It works correctly on all but one templates. I added an image, it shows the image uploading, but then the image just disappears and it doesn't save. What could it be ?

 

Thanks

Link to comment
Share on other sites

I enabled debugger, and now I see this error when I upload an image

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

parseJSON .../wire/modules/Jquery/JqueryCore/JqueryCore.js:2:13582
uploadFile/< .../wire/modules/Inputfield/InputfieldImage/InputfieldImage.js:1450:21

Link to comment
Share on other sites

Hmm that error means either pw returns empty json or you echo a string somewhere and json becomes invalid. 

On your developer console (F12) activate network tab then try adding an image, inspect the request and response values, check if something weird is going on

Link to comment
Share on other sites

also, just noticed that this error is happening on every single image field now. i can't upload new images to the site.

i didn't make any edits to the server, so not sure why this is happening all of a sudden

Link to comment
Share on other sites

I've just checked the source for InputfieldImage and it definitely originates from the backend. Somehow along the way json gets corrupted/wrong data is returned. 

You need to check the server response using developer console to get an idea of what it really is. 

https://developers.google.com/web/tools/chrome-devtools/network-performance/reference

Just to cross it off the list, try downloading the latest source from GitHub and replacing /wire/ directory. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...