Jump to content

Recommended Posts

Posted

Hello, I am facing an upload issue. I get this JS error when I drop images in image fields:

XHR POSThttps://foo.com/admin/page/edit/?id=1102&InputfieldFileAjax=1[HTTP/2 403 41ms]

Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    uploadFile https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    traverseFiles https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    setupDropzone https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    initHTML5Item https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    jQuery 2
    initUploadHTML5 https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    init https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    InputfieldImage https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    <anonymous> https://foo.com/wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js?v=122-3.0.246:1
    jQuery 8

InputfieldImage.min.js:1:35804

image.png.7459bf635f0945025093730e0ebf6e1d.png

 

I updated PW recently and also upgraded the PHP version. Maybe that can be related!

Posted

Check PW error logs. This is because of the error in php/module resulting in invalid JSON. Do a modules refresh and upgrade them to the latest version.

Posted

Thank you @matjazp. I refreshed the modules from the log.
I think I updated all the module that needed to be updated (I guess). I also installed the Upgrades module to be sure. The logs doesn’t log anything when I try to upload an image. The error remains.

My FieldtypeFile module is at v. 1.0.7 and FieldtypeImage at v. 1.0.2. 

Posted

Yes I have PHP 8.4. I tried to install the PW version you advise, but my site and admin went totally blank, even with debug enabled in config.

Posted

Do you have access to admin? To the file system? Double check that you uploaded the complete wire directory and new indxex.php file.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...