forked from Wavyzz/dolibarr
Fix regression triggers was not triggered
This commit is contained in:
@@ -328,7 +328,7 @@ class Paiement extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::create insert paiement", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::create insert paiement (closepaidinvoices = ".$closepaidinvoices.")", LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@@ -494,6 +494,8 @@ class Paiement extends CommonObject
|
||||
|
||||
$result = $invoice->generateDocument($invoice->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
dol_syslog(get_class($this).'::create Regenerate end result='.$result, LOG_DEBUG);
|
||||
|
||||
if ($result < 0) {
|
||||
$this->error = $invoice->error;
|
||||
$this->errors = $invoice->errors;
|
||||
@@ -509,6 +511,8 @@ class Paiement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this).'::create Now we call the triggers if no error (error = '.$error.')', LOG_DEBUG);
|
||||
|
||||
if (!$error) { // All payments into $this->amounts were recorded without errors
|
||||
// Appel des triggers
|
||||
$result = $this->call_trigger('PAYMENT_CUSTOMER_CREATE', $user);
|
||||
|
||||
@@ -84,7 +84,7 @@ class Interfaces
|
||||
if (!is_object($langs)) { // Warning
|
||||
dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
||||
}
|
||||
if (!is_object($user)) { // Warning
|
||||
if (!is_object($user)) { // Warning
|
||||
dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
|
||||
$user = new User($this->db);
|
||||
}
|
||||
@@ -128,8 +128,7 @@ class Interfaces
|
||||
$qualified = true;
|
||||
if (strtolower($reg[2]) != 'all') {
|
||||
$module = preg_replace('/^mod/i', '', $reg[2]);
|
||||
$constparam = 'MAIN_MODULE_'.strtoupper($module);
|
||||
if (!isModEnabled($constparam)) {
|
||||
if (!isModEnabled(strtolower($module))) {
|
||||
$qualified = false;
|
||||
}
|
||||
}
|
||||
@@ -341,10 +340,9 @@ class Interfaces
|
||||
// Check if trigger file is for a particular module
|
||||
if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) {
|
||||
$module = preg_replace('/^mod/i', '', $reg[2]);
|
||||
$constparam = 'MAIN_MODULE_'.strtoupper($module);
|
||||
if (strtolower($module) == 'all') {
|
||||
$disabledbymodule = 0;
|
||||
} elseif (empty($conf->global->$constparam)) {
|
||||
} elseif (!isModEnabled(strtoupper($module))) {
|
||||
$disabledbymodule = 2;
|
||||
}
|
||||
$triggers[$j]['module'] = strtolower($module);
|
||||
|
||||
Reference in New Issue
Block a user