Skip to content

Commit

Permalink
Fix: [ bug #1449 ] Trigger ORDER_CREATE ignores interception on error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgdf committed Jun 10, 2014
1 parent ae0116a commit 0c1ba58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -9,6 +9,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo
supplier order card
Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or
limit date for payment
Fix: [ bug #1449 ] Trigger ORDER_CREATE ignores interception on error

***** ChangeLog for 3.5.3 compared to 3.5.2 *****
Fix: Error on field accountancy code for export profile of invoices.
Expand Down
15 changes: 13 additions & 2 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -795,8 +795,19 @@ function create($user, $notrigger=0)
// Fin appel triggers
}

$this->db->commit();
return $this->id;
if (!$error) {
$this->db->commit();
return $this->id;
}

foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;

}
else
{
Expand Down

0 comments on commit 0c1ba58

Please sign in to comment.