Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action

This commit is contained in:
KreizIT 2014-07-04 16:23:10 +02:00
parent 4666de85e2
commit c70bdabeda
2 changed files with 10 additions and 9 deletions

View File

@ -22,6 +22,7 @@ For users:
- Fix: [ bug #1498, #1499 ] Shipment/Delivery triggers problem - Fix: [ bug #1498, #1499 ] Shipment/Delivery triggers problem
- Fix: [ bug #1465, #1466 ] Product triggers problem - Fix: [ bug #1465, #1466 ] Product triggers problem
- Fix: [ bug #1508 ] STOCK_MOVEMENT does not show trigger error message - Fix: [ bug #1508 ] STOCK_MOVEMENT does not show trigger error message
- Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action
For translators: For translators:

View File

@ -126,15 +126,15 @@ class Deplacement extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."deplacement"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."deplacement");
// Appel des triggers // Call trigger
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $result=$this->call_trigger('DEPLACEMENT_CREATE',$user);
$interface=new Interfaces($this->db); if ($result < 0)
$result=$interface->run_triggers('DEPLACEMENT_CREATE',$this,$user,$langs,$conf); {
if ($result < 0) { $this->db->rollback();
$error++; $this->errors=$interface->errors; return -2;
} }
// Fin appel triggers // End call triggers
$result=$this->update($user); $result=$this->update($user);
if ($result > 0) if ($result > 0)
{ {