Skip Navigation

[Resolved] Error when user uploads file to Media Library

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by KentS9937 4 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1338231

I am trying to let a user with a custom role called "supervisor" to upload a file via a CRED form. I expect the image file to be uploaded correctly and then displayed on the form. Instead the user is getting an error message "An error occurred in the upload. Please try again later."

This had been working just fine, but for some reason it started giving this error message recently. It's unclear how recently the errors started as the user just recently informed me.

I have tried doing the upload as an admin and it works just fine. This made me think the problem was with access rights. I investigated the supervisor's media access rights in Access. Everything there is checked. Do I also need to make sure any special capabilities are enabled in the custom role for "Supervisor"?

Link to a page where the issue can be seen: This cannot be seen without logging into the site as a supervisor. I can give you the login credentials if needed.

#1338309

Hello,

The problem you mentioned above is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and form URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1339293
media1.JPG
media2.JPG

Thanks for the details, I can import your database dump file into my localhost, but there isn't similar problem in my localhost, see screenshot media1.JPG and media2.JPG

So it should be a compatibility/server problem in your website, did you get any PHP debug logs?
See my first answer above:
https://toolset.com/forums/topic/error-when-user-uploads-file-to-media-library/#post-1338309

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#1339947
console_snapshot.PNG

I did not get any php errors. Error log is available at this link. hidden link

I also did not get any console errors as you can see in the attached image.

I'm stumped as I can change the user to admin role and it works fine. Change it back to supervisor and I get the error message after uploading the image.

I'm happy to provide ftp credentials if that's helpful.

#1340635

OK, please backup your website, then provide credentials and FTP access in below private message box, thanks

#1341609

Yes, I did try with user "supervisor" in my localhost using your database dump file, it works fine in my localhost.

I can log into your website, will update here if there is anything found.

#1341611

Here are what I found in your website:
After I switch theme from "GeneratePress Child" to it's parent theme "GeneratePress"
it works fine, can you test again?

Since there are lots of custom codes in the child theme "GeneratePress Child", there should be some problem in those custom codes.

#1345015

Thanks. I'll investigate my child theme and functions.php to see what might be impacting this.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.