rooofl Posted 15 hours ago Posted 15 hours ago 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 I updated PW recently and also upgraded the PHP version. Maybe that can be related!
matjazp Posted 13 hours ago Posted 13 hours ago 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.
rooofl Posted 12 hours ago Author Posted 12 hours ago 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.
matjazp Posted 12 hours ago Posted 12 hours ago You have PHP 8.4? Then use the latest (not yet dev): https://github.com/processwire/processwire/archive/dbbb239a74231d5371c77cd23cb6e48aba90b8ef.zip
rooofl Posted 11 hours ago Author Posted 11 hours ago 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.
matjazp Posted 11 hours ago Posted 11 hours ago Do you have access to admin? To the file system? Double check that you uploaded the complete wire directory and new indxex.php file.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now