Index: kernel/db/dbitem.php =================================================================== --- kernel/db/dbitem.php (revision 15454) +++ kernel/db/dbitem.php (working copy) @@ -535,17 +535,18 @@ */ public function processUploads($id = NULL) { + $changed_fields = Array (); $uploader_fields = $this->_getUploaderFields(); foreach ($uploader_fields as $field) { $formatter = $this->Application->recallObject($this->GetFieldOption($field, 'formatter')); /* @var $formatter kUploadFormatter */ - $this->SetDBField($field, $formatter->processFlashUpload($this, $field, $id)); + $changed_fields = array_merge($changed_fields, $formatter->processFlashUpload($this, $field, $id)); } - if ( $this->GetChangedFields() ) { - $this->Update(); + if ( $changed_fields ) { + $this->Update(null, array_unique($changed_fields)); } } Index: kernel/utility/formatters/upload_formatter.php =================================================================== --- kernel/utility/formatters/upload_formatter.php (revision 15446) +++ kernel/utility/formatters/upload_formatter.php (working copy) @@ -279,7 +279,7 @@ * @param kDBItem $object * @param string $field_name * @param int $id - * @return string + * @return Array */ public function processFlashUpload($object, $field_name, $id = null) { @@ -292,7 +292,7 @@ if ( !$files_info ) { $this->Application->RemoveVar($object->getFileInfoVariableName($field_name, $id)); - return $value; + return Array (); } $files_info = unserialize($files_info); @@ -324,8 +324,13 @@ } $this->Application->RemoveVar($object->getFileInfoVariableName($field_name, $id)); + $object->SetDBField($field_name, implode('|', $live_files)); - return implode('|', $live_files); + if ( $object->GetOriginalField($field_name, true) != $object->GetField($field_name) ) { + return Array ($field_name); + } + + return Array (); } /**