Gallery field not working for some users

Created by Phil Kurth, Modified on Wed, 20 Jul 2022 at 02:50 PM by Phil Kurth

When using the gallery field, you might find that it doesn't work for some users. i.e; when they click the 'add to gallery' button, nothing happens in the UI and the following error appears in the browser console:



This is not a bug in Advanced Forms — it's a limitation enforced by WordPress which requires users to have the upload_files capability before it will load the scripts and resources required to use the media uploader. 


This means that the gallery field can only be used in a front end form by logged in users who have the right capability.


The fix for this is to add the upload_files capability to the user roles who should be able to use the media uploader. You may consider using the User Role Editor plugin or something similar to do so.


How to support non-logged in users


If you need to offer the ability for non logged-in users to upload a gallery of images, you might consider using a repeater field containing regular image/file upload fields. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article