Skip to content
Snippets Groups Projects
Commit b8867463 authored by Tim Steiner's avatar Tim Steiner
Browse files

Fixed a bug when removing a file attached to multiple requests.

parent 9e9540b6
No related branches found
No related tags found
No related merge requests found
......@@ -724,8 +724,13 @@ class Requests_RequestModel extends Unl_Model
}
$sql = $db->quoteInto('DELETE FROM creqRequestFiles WHERE requestFileId IN (?)', $requestFileIds);
$db->query($sql);
$sql = $db->quoteInto('DELETE FROM creqFiles WHERE fileId IN (?)', $fileIds);
$db->query($sql);
try {
$sql = $db->quoteInto('DELETE FROM creqFiles WHERE fileId IN (?)', $fileIds);
$db->query($sql);
} catch (Zend_Db_Statement_Exception $e) {
// If the file is used by multiple requsets, an integrity exception will be thrown.
// We should just ignore it since it turns out we didn't want to delete this file anyway.
}
}
static protected function _saveFileToDisk($data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment