srs81 / CakePHP-AjaxMultiUpload

CakePHP 2 plugin to allow for easy multi-file upload with AJAX
Other
65 stars 33 forks source link

Upload with no id present (Add view) #33

Closed deluca687 closed 11 years ago

deluca687 commented 11 years ago

I'm unable to upload in my add view because of an undefined index

Notice (8): Undefined index: Document.id

Seeing as the id isn't yet present within the db table, is it possible to add files to the upload list, then invoke public $components = array('AjaxMultiUpload.Upload'); in an afterSave callback, something like:

function afterSave($created) { if($created) { public $components = array('AjaxMultiUpload.Upload'); } }

This of course doesn't work because there is no component loaded within the controller itself. I couldn't think of another way to do this while adding a new record.

Any ideas?

gabeidx commented 11 years ago

See #9.

deluca687 commented 11 years ago

Ah sorry must have missed that, thanks.