Fix #1999 missing rollback on query error during updateVotedCount

This commit is contained in:
Kijin Sung 2022-10-11 01:09:05 +09:00
parent c2bf7d65ce
commit 9bc69abe0b

View file

@ -1793,7 +1793,11 @@ class documentController extends document
$args->voted_count = $trigger_obj->after_point;
$output = executeQuery('document.updateVotedCount', $args);
}
if(!$output->toBool()) return $output;
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Leave in the session information
$_SESSION['voted_document'][$document_srl] = $trigger_obj->point;
@ -1801,7 +1805,11 @@ class documentController extends document
// Leave logs
$args->point = $trigger_obj->point;
$output = executeQuery('document.insertDocumentVotedLog', $args);
if(!$output->toBool()) return $output;
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Call a trigger (after)
ModuleHandler::triggerCall('document.updateVotedCount', 'after', $trigger_obj);