|UploadField::isSaveable()||Uncle Cheese||8/31/12 6:11 AM|
When I use the "From Files" feature on an unsaved record, I get a "Forbidden" error. This is because UploadField::managesRelation() returns false, and that can be traced back to $this->form->getRecord() returning null.
Looking more carefully at the API, this should never happen because an UploadField shouldn't render when IsSavable is false.
But the isSaveable() function is curious.
return (!$record || !$this->managesRelation() || $record->exists());
It's the first two conditions that really get me. Shouldn't it be the opposite?
|Re: [silverstripe-dev] UploadField::isSaveable()||Sigurd Magnusson||8/31/12 3:50 PM|
Better still, save file to temp folder and link it/move it upon save. User friendly.
Sent from my iPhone