I’m getting the following error when i’m logged out and clicking the Add Image button when using acf_form on the frontend
Uncaught TypeError: Cannot read property 'query' of undefined acf.media.acf.model.extend.popup @ acf-input.min.js?ver=5.3.0:1acf.fields.image_crop.acf.field.extend.add @ input.js?ver=4.3:51(anonymous function) @ acf-input.min.js?ver=5.3.0:1m.event.dispatch @ jquery.js?ver=1.11.3:4m.event.add.r.handle @ jquery.js?ver=1.11.3:4
but to no avail.
What type of field is this? I think it’s a gallery field by reading between the lines of your question. If it is, I just answered another question about this and I’ve flagged that post for the developer to take a look at.
It is just an Image field with the Crop add-on, I don’t think this is a gallery field?
Crop add on? what is a crop add on? Can you give me more information on this?
Ok, I disabled the crop add-on and it’s working when logged out. It’s now just the basic windows add file dialog vs the media library that the crop add-on provided.
Sorry, I actually forgot the crop add-on changed the way things are chosen and uploaded.
I’m guessing the developer of the crop add-on didn’t take into account people using acf_form() thus when the user is logged out, the scripts are not enqueued or something.
The add-on is here https://wordpress.org/plugins/acf-image-crop-add-on/
Anything that needs to interact with the media gallery has a problem when not logged in. There was also a recent topic here about not being able to use a gallery field when not logged in that caused a JS error. I think that allowing access to the media library in WP will be a serious hurdle for anyone, honestly, I’m not sure it can be done at all without exposing your site to some serious security problems.
I’m getting the same error message but I’m not using an addon. I’ve raised a support call but haven’t heard any updates for awhile…
After struggling with these same errors, I just wanted to point out that a user logged in as a subscriber or a contributor is unable to utilize the gallery on the frontend as well. You must have at least an Author user level.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.