Index: branches/5.2.x/units/files/files.php =================================================================== diff -u -N -r14258 -r14625 --- branches/5.2.x/units/files/files.php (.../files.php) (revision 14258) +++ branches/5.2.x/units/files/files.php (.../files.php) (revision 14625) @@ -1,6 +1,6 @@ Load($id); - $upload_dir = $this->Fields['FilePath']['upload_dir']; - $file_path = FULL_PATH.$upload_dir.$this->GetDBField('FilePath'); - if(file_exists($file_path)) - { - unlink($file_path); - } - return parent::Delete($id); + /** + * Deletes the record from database + * + * @param int $id + * @return bool + * @access public + */ + public function Delete($id = null) + { + $this->Load($id); + $upload_dir = $this->Fields['FilePath']['upload_dir']; + $file_path = FULL_PATH . $upload_dir . $this->GetDBField('FilePath'); + + if ( file_exists($file_path) ) { + unlink($file_path); } - } \ No newline at end of file + + return parent::Delete($id); + } +} \ No newline at end of file