mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Do not rollback if an 'after' trigger returns error
This commit is contained in:
parent
2300106aa5
commit
eb895f76cd
13 changed files with 81 additions and 227 deletions
|
|
@ -219,10 +219,10 @@ class communicationController extends communication
|
|||
$trigger_obj->title = $title;
|
||||
$trigger_obj->content = $content;
|
||||
$trigger_obj->sender_log = $sender_log;
|
||||
$triggerOutput = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj);
|
||||
if(!$triggerOutput->toBool())
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
return $triggerOutput;
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
|
|
@ -248,12 +248,7 @@ class communicationController extends communication
|
|||
}
|
||||
|
||||
// Call a trigger (after)
|
||||
$trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $trigger_output;
|
||||
}
|
||||
ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj);
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue