Merge pull request #1132 from sejin7940/document_delete

게시글을 삭제 시 해당 글에 첨부된 첨부파일이 삭제되지 않는 문제 고침
This commit is contained in:
bnu 2015-01-05 13:47:33 +09:00
commit 182572ce49

View file

@ -847,12 +847,6 @@ class fileController extends file
// Success returned if no attachement exists
if(!is_array($file_list)||!count($file_list)) return new Object();
// Remove from the DB
$args = new stdClass();
$args->upload_target_srl = $upload_target_srl;
$output = executeQuery('file.deleteFiles', $args);
if(!$output->toBool()) return $output;
// Delete the file
$path = array();
$file_count = count($file_list);
@ -864,6 +858,13 @@ class fileController extends file
$path_info = pathinfo($uploaded_filename);
if(!in_array($path_info['dirname'], $path)) $path[] = $path_info['dirname'];
}
// Remove from the DB
$args = new stdClass();
$args->upload_target_srl = $upload_target_srl;
$output = executeQuery('file.deleteFiles', $args);
if(!$output->toBool()) return $output;
// Remove a file directory of the document
for($i=0, $c=count($path); $i<$c; $i++)
{