mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-17 17:32:15 +09:00
issue 2256 add trigger, transaction in updateVotedCount method.
patch by bnufactory. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11059 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7b5394a737
commit
b982bacbb5
1 changed files with 21 additions and 0 deletions
|
|
@ -790,6 +790,10 @@
|
|||
return new Object(-1, $failed_voted);
|
||||
}
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// update the number of votes
|
||||
if($point < 0) {
|
||||
$args->blamed_count = $oComment->get('blamed_count') + $point;
|
||||
|
|
@ -801,6 +805,23 @@
|
|||
// leave logs
|
||||
$args->point = $point;
|
||||
$output = executeQuery('comment.insertCommentVotedLog', $args);
|
||||
|
||||
$obj->member_srl = $oComment->get('member_srl');
|
||||
$obj->module_srl = $oComment->get('module_srl');
|
||||
$obj->comment_srl = $oComment->get('comment');
|
||||
$obj->update_target = ($point < 0) ? 'blamed_count' : 'voted_count';
|
||||
$obj->point = $point;
|
||||
$obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
|
||||
$obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
// leave into session information
|
||||
$_SESSION['voted_comment'][$comment_srl] = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue