Home › Forums › Backend Issues (wp-admin) › Image and file fields not working
Uncaught TypeError: _.contains is not a function
at Function.r.extend.get (media-models.min.js?ver=5.7:2)
at n._requery (media-models.min.js?ver=5.7:2)
at n._changeQuery (media-models.min.js?ver=5.7:2)
at p (backbone.min.js?ver=1.4.0:2)
at f (backbone.min.js?ver=1.4.0:2)
at c (backbone.min.js?ver=1.4.0:2)
at h.Model.n.trigger (backbone.min.js?ver=1.4.0:2)
at h.Model.set (backbone.min.js?ver=1.4.0:2)
at n.initialize (media-models.min.js?ver=5.7:2)
at n.h.Collection (backbone.min.js?ver=1.4.0:2)
Hello,
i am getting the above error with image and file fields registered via PHP, when i click on the upload file button, and nothing happens.
Plugin Version 5.9.5 , free version.
The generated html for the field is this:
<div class="acf-field acf-field-file acf-field-evolcorr-hero-image" data-name="evolcorr_hero_image" data-type="file" data-key="field_evolcorr_hero_image" style="">
<div class="acf-label">
<label for="acf-field_evolcorr_hero_image">Show hero image on page</label></div>
<div class="acf-input">
<div class="acf-file-uploader" data-library="all" data-mime_types="" data-uploader="wp">
<input type="hidden" name="acf[field_evolcorr_hero_image]" value="" data-name="id"> <div class="show-if-value file-wrap">
<div class="file-icon">
<img data-name="icon" src="" alt="">
</div>
<div class="file-info">
<strong data-name="title"></strong>
<strong>File name:</strong>
<a data-name="filename" href="" target="_blank"></a>
<strong>File size:</strong>
<span data-name="filesize"></span>
</div>
<div class="acf-actions -hover">
<a class="acf-icon -pencil dark" data-name="edit" href="#" title="Edit"></a>
<a class="acf-icon -cancel dark" data-name="remove" href="#" title="Remove"></a>
</div>
</div>
<div class="hide-if-value">
No file selected <a data-name="add" class="acf-button button" href="#">Add File</a>
</div>
</div>
</div>
</div>
This must be caused by a 3rd party plugin incompatibility.
In my case it was Yoast.
Try to update it and the error will be fixed.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.