Support

Account

Home Forums Backend Issues (wp-admin) Image and file fields not working

Helping

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.

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

You must be logged in to reply to this topic.