Support

Account

Home Forums Front-end Issues Javascript error acf_form image upload logged out

Solved

Javascript error acf_form image upload logged out

  • Hi,

    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

    I’ve added

    acf_form_head()

    and also

    <script type="text/javascript">
        (function($) {
            // setup fields
            acf.do_action('append', $('#popup-id'));
    
        })(jQuery);
    </script>

    and also

    acf_enqueue_uploader();

    but to no avail.

    Any ideas?

    Thanks.

  • 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.

    http://support.advancedcustomfields.com/forums/topic/frontend-gallery-field/

  • Hi John,

    It is just an Image field with the Crop add-on, I don’t think this is a gallery field?

    Thanks,

    Jesse

  • 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/

    Thanks

  • 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.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Javascript error acf_form image upload logged out’ is closed to new replies.