Skip to content
Browse files

dont remove files on every save. [fixes #16]

  • Loading branch information...
1 parent 62fec63 commit 39655e1775032d017fdff0ada5f682221cd0ede5 @szajbus committed Oct 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Model/Behavior/UploadBehavior.php
View
2 Model/Behavior/UploadBehavior.php
@@ -47,7 +47,7 @@ public function beforeSave(&$model) {
$model->data[$model->name][$field.'_file_name'] = $this->toWrite[$field]['name'];
$model->data[$model->name][$field.'_file_size'] = $this->toWrite[$field]['size'];
$model->data[$model->name][$field.'_content_type'] = $this->toWrite[$field]['type'];
- } elseif ($model->data[$model->name][$field] === null) {
+ } elseif (array_key_exists($field, $model->data[$model->name]) && $model->data[$model->name][$field] === null) {
if (!empty($model->id)) {
$this->_prepareToDeleteFiles($model, $field, true);
}

0 comments on commit 39655e1

Please sign in to comment.
Something went wrong with that request. Please try again.