Fix module_srl not being updated for files attached to comments, when a document is moved to a different module

This commit is contained in:
Kijin Sung 2025-03-13 22:38:05 +09:00
parent f6a9d49db1
commit b213fc1968
2 changed files with 15 additions and 7 deletions

View file

@ -1971,8 +1971,16 @@ class FileController extends File
function triggerMoveDocument($obj) function triggerMoveDocument($obj)
{ {
$obj->upload_target_srls = $obj->document_srls; $obj->upload_target_srls = $obj->document_srls;
executeQuery('file.updateFileModule', $obj); $output = executeQuery('file.updateFileModule', $obj);
executeQuery('file.updateFileModuleComment', $obj); if (!$output->toBool())
{
return $output;
}
$output = executeQuery('file.updateFileModuleComment', $obj);
if (!$output->toBool())
{
return $output;
}
} }
function triggerAddCopyDocument(&$obj) function triggerAddCopyDocument(&$obj)

View file

@ -1,13 +1,13 @@
<query id="updateFileModuleComment" action="update"> <query id="updateFileModuleComment" action="update">
<tables> <tables>
<table name="files" /> <table name="files" alias="f" />
<table name="comments" /> <table name="comments" alias="c" />
</tables> </tables>
<columns> <columns>
<column name="files.module_srl" var="module_srl" filter="number" notnull="notnull" /> <column name="f.module_srl" var="module_srl" filter="number" notnull="notnull" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="files.upload_target_srl" default="comments.comment_srl" /> <condition operation="equal" column="f.upload_target_srl" default="c.comment_srl" />
<condition operation="in" column="comments.document_srl" var="upload_target_srls" filter="number" notnull="notnull" pipe="and" /> <condition operation="in" column="c.document_srl" var="upload_target_srls" filter="number" notnull="notnull" pipe="and" />
</conditions> </conditions>
</query> </query>