Yes what StevieC said. Users need to have a minimum of an Author role in order to upload media files otherwise you get that non-descriptive error,
Might be interesting to know that it’s to upload files without permissions if you do it through acf_form() in the front end. However then it will always use the regular upload input type rather than WordPress native.
Just some info for people that might find this topic.
I think it actually defaults to the basic uploader if you don’t have permissions. However, the gallery field is the control that does not work.
I am also getting the same error as @tabboy but on line 10260 in acf-input.js. I have an Image field inside of a repeater and when I click on ‘Add Image’, I receive an “Uncaught TypeError: Cannot read ‘query’ of undefined” for the following:
var Query = wp.media.query( options.library );
I am using WordPress 5.2.4 and ACF Pro Version 5.8.6.
I would also like to mention that this is happening on a Charitable campaigns post in the backend. Here is a reference to that plugin: https://www.wpcharitable.com/extensions/charitable-ambassadors/
To test whether it has something to do with the repeater, I created a new field group with just an Image field to show on my campaign post but that also didn’t work so the repeater is not at fault. For some reason, the media modal is not opening up as it should.
I have tried this on both Chrome and Firefox with no luck.
Any help is much appreciated! Thank you!
I have read all the post. Have the same problem, but inside the editor of pages (where my admin upload posts.. not public)
The error raises upon pressing the “upload image” button. No dialog appears.
Console error is:
acf-input.min.js?ver=5.8.7:3 Uncaught TypeError: Cannot read property 'query' of undefined at n.addFrameStates (acf-input.min.js?ver=5.8.7:3) at n.initialize (acf-input.min.js?ver=5.8.7:3) at n.e (acf-input.min.js?ver=5.8.7:1) at n.acf.Model (acf-input.min.js?ver=5.8.7:1) at n [as constructor] (acf-input.min.js?ver=5.8.7:1) at new n (acf-input.min.js?ver=5.8.7:1) at Object.acf.newMediaPopup (acf-input.min.js?ver=5.8.7:3) at n.selectAttachment (acf-input.min.js?ver=5.8.7:2) at n.onClickAdd (acf-input.min.js?ver=5.8.7:2) at n.<anonymous> (acf-input.min.js?ver=5.8.7:1)
Wordpress ver 5.3.1
All plugins updated
any ideas? I’m driving mad.
So the solution for me was to install the extension and luckily that fixed everything.
Are you editing WordPress pages or pages from a plugin? If it is from a plugin, I would try contacting them.
Best of luck!
I know this is an old thread now, but what did the trick for me (on WP 5.5.3 and ACF PRO 5.9.3) is just adding this to the template I’m working on:
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!
© 2020 Advanced Custom Fields. Subscribe