diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php
index d93dfcb25..87e570ac0 100644
--- a/modules/comment/comment.item.php
+++ b/modules/comment/comment.item.php
@@ -314,7 +314,7 @@
if(!$this->get('uploaded_count')) return;
$oFileModel = &getModel('file');
- $file_list = $oFileModel->getFiles($this->comment_srl, $is_admin);
+ $file_list = $oFileModel->getFiles($this->comment_srl, array(), 'file_srl', true);
return $file_list;
}
diff --git a/modules/document/document.item.php b/modules/document/document.item.php
index 567873db9..e72deeb2a 100644
--- a/modules/document/document.item.php
+++ b/modules/document/document.item.php
@@ -675,7 +675,7 @@
// Find an iamge file among attached files if exists
if($this->get('uploaded_count')) {
$oFileModel = &getModel('file');
- $file_list = $oFileModel->getFiles($this->document_srl);
+ $file_list = $oFileModel->getFiles($this->document_srl, array(), 'file_srl', true);
if(count($file_list)) {
foreach($file_list as $file) {
if($file->direct_download!='Y') continue;
@@ -819,7 +819,7 @@
if(!$this->uploadedFiles[$sortIndex])
{
$oFileModel = &getModel('file');
- $this->uploadedFiles[$sortIndex] = $oFileModel->getFiles($this->document_srl, array(), $sortIndex);
+ $this->uploadedFiles[$sortIndex] = $oFileModel->getFiles($this->document_srl, array(), $sortIndex, true);
}
return $this->uploadedFiles[$sortIndex];
diff --git a/modules/file/file.model.php b/modules/file/file.model.php
index 34005e0d3..5c251107d 100644
--- a/modules/file/file.model.php
+++ b/modules/file/file.model.php
@@ -177,9 +177,10 @@
* @param string $sortIndex The column that used as sort index
* @return array Returns array of object that contains file information. If no result returns null.
**/
- function getFiles($upload_target_srl, $columnList = array(), $sortIndex = 'file_srl') {
+ function getFiles($upload_target_srl, $columnList = array(), $sortIndex = 'file_srl', $ckValid = false) {
$args->upload_target_srl = $upload_target_srl;
$args->sort_index = $sortIndex;
+ if($ckValid) $args->isvalid = 'Y';
$output = executeQuery('file.getFiles', $args, $columnList);
if(!$output->data) return;
diff --git a/modules/file/queries/getFiles.xml b/modules/file/queries/getFiles.xml
index 66ef5e905..d0e326fb3 100644
--- a/modules/file/queries/getFiles.xml
+++ b/modules/file/queries/getFiles.xml
@@ -4,6 +4,7 @@
+