diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 3bdd7c785..f77462546 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -1723,14 +1723,18 @@ class FileController extends File // Get a full list of attachments $args = new stdClass; $args->module_srl = $module_srl; - $output = executeQueryArray('file.getModuleFiles', $args); - if(!$output->toBool() || empty($file_list = $output->data)) + $output = executeQueryArray('file.getModuleFilesProper', $args); + if (!$output->toBool()) { return $output; } + if (!$output->data) + { + return; + } - // Delete the file - return $this->deleteFile($file_list); + // Delete each file. + return $this->deleteFile($output->data); } /** diff --git a/modules/file/queries/getModuleFilesProper.xml b/modules/file/queries/getModuleFilesProper.xml new file mode 100644 index 000000000..bbfb72108 --- /dev/null +++ b/modules/file/queries/getModuleFilesProper.xml @@ -0,0 +1,31 @@ + + + +
+ + + +
+ + + + +
+
+ + + + + + + + + + + + + + + + +