Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

uploadfield modfications CMS 3.1.1


Go to End


1134 Views

Avatar
badjedi

Community Member, 25 Posts

21 October 2013 at 9:07am

I have tried using yaml or jus the config examples in http://doc.silverstripe.org/framework/en/reference/uploadfield.

But none seem to work properly as in setting custom folder or canUpload. They appear to have some effect, but don;t work.

canUpload false will remove the "from computer" option, but then when you click "from files" to pick a image form files, I get his following error in the 8javascript inspector:

Uncaught exception TypeError {} in onmatch on
<div id=​"Photo" class=​"field upload ss-upload ss-uploadfield">​…​</div>​
lib.js?m=1382296084:1629
Stack Trace:
TypeError: Cannot call method 'replace' of undefined
at jQuerySub.$.entwine.onmatch (http://localhost:8888/lapisaronda/assets/_combinedfiles/uploadfield.js?m=1382296278:113:393)
at Array.proxy [as onmatchproxy] (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:1676:216)
at HTMLDocument.<anonymous> (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:1691:131)
at HTMLDocument.jQuery.event.dispatch (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:207:482)
at HTMLDocument.elemData.handle.eventHandle (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:174:182)
at Object.jQuery.event.trigger (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:198:209)
at jQuery.fn.extend.triggerHandler (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:246:759)
at Base.extend.triggerEvent (http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:1656:261)
at http://localhost:8888/lapisaronda/assets/_combinedfiles/lib.js?m=1382296084:1656:424 lib.js?m=1382296084:1629
XHR finished loading: "http://localhost:8888/lapisaronda/admin/pages/treeview". lib.js?m=1382296084:531
Uncaught TypeError: Cannot read property 'urlSelectDialog' of null

and no php errors..

I tried several other uploadfield form modifications, but the only one that could work is setAutoUpload.

Does any one have any ideas?