frankmullenger / silverstripe-gallery

Image gallery for SilverStripe 3
23 stars 17 forks source link

GalleryUploadField doesn't work in 3.1 (causes JS error) #7

Closed micmania1 closed 10 years ago

micmania1 commented 10 years ago

I get an error using Silverstripe 3.1.2 which prevents the upload field from working.

See below:

Uncaught exception TypeError {} in onmatch on 
<div id=​"Images" class=​"field galleryupload ss-upload ss-uploadfield nolabel">​
<div class=​"middleColumn">​…​</div>​
</div>​
 jquery.entwine-dist.js?m=1377785678:888
Stack Trace:
TypeError: Cannot read property 'innerHTML' of null
    at Function.tmpl.load (http://mysite.com/framework/thirdparty/javascript-templates/tmpl.js?m=1377785678:34:43)
    at tmpl (http://mysite.com/framework/thirdparty/javascript-templates/tmpl.js?m=1377785678:22:27)
    at $.widget._initTemplates (http://mysite.com/framework/javascript/UploadField.js?m=1385383870:7:41)
    at null._initTemplates (http://mysite.com/framework/thirdparty/jquery-ui/jquery-ui.js?m=1377785678:431:26)
    at $.widget._create (http://mysite.com/framework/thirdparty/jquery-fileupload/jquery.fileupload-ui.js?m=1377785678:517:18)
    at null.<anonymous> (http://mysite.com/framework/thirdparty/jquery-ui/jquery-ui.js?m=1377785678:431:26)
    at $.widget._create (http://mysite.com/framework/javascript/UploadField.js?m=1385383870:104:45)
    at null._create (http://mysite.com/framework/thirdparty/jquery-ui/jquery-ui.js?m=1377785678:431:26)
    at $.Widget._createWidget (http://mysite.com/framework/thirdparty/jquery-ui/jquery-ui.js?m=1377785678:596:8)
    at new $.(anonymous function).(anonymous function) (http://mysite.com/framework/thirdparty/jquery-ui/jquery-ui.js?m=1377785678:395:9) jquery.entwine-dist.js?m=1377785678:891
frankmullenger commented 10 years ago

Thanks, looks like the template has changed for UploadField perhaps? This issue persists after flushing the templates?

thezenmonkey commented 10 years ago

I've just worked through this, I think I've found the changes

frankmullenger commented 10 years ago

@micmania1 this has now been fixed using @thezenmonkey's work on the 1.1 branch.

tekurinui commented 8 years ago

I've just installed using composer and I think I've run in to the same problem. Composer.json tells me it's using dev-master. Any ideas how I resolve?

tekurinui commented 8 years ago

Figured out how to change composer to use 1.1, all good now thanks.