I have an UploadField in a form with setCanAttachExisting(true).
When clicking on the fromFiles button i get the JavaScript error and it doesn't allow users to select an existing image.
Uncaught ReferenceError: jQuery is not defined UploadField_select.js?m=1396993466:21
(anonymous function).
Even though the built in CMS loads the jQuery file before.
If i append the UploadField_Select.js file in the framework with jQuery before it. I get the error
Uncaught TypeError: undefined is not a function UploadField_select.js?m=1397667809:8
I get both these errors with 3.1.4(Dev) and 3.1.2 (Live/Dev)
the default UploadField_Select file
--
(function($) {
$.entwine('ss', function($) {
// Install the directory selection handler
$('form.uploadfield-form #ParentID .TreeDropdownField').entwine({
onmatch: function() {
this._super();
var self = this;
this.bind('change', function() {
// Display the contents of the folder in the listing field.
var fileList = self.closest('form').find('.ss-gridfield');
fileList.setState('ParentID', self.getValue());
fileList.reload();
});
},
onunmatch: function() {
this._super();
}
});
});
})(jQuery);
--