forked from Wavyzz/dolibarr
set errors from object
This commit is contained in:
@@ -1726,8 +1726,7 @@ class Adherent extends CommonObject
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->error = $subscription->error;
|
$this->setErrorsFromObject($subscription);
|
||||||
$this->errors = $subscription->errors;
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -669,6 +669,23 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setErrorsFromObject
|
||||||
|
*
|
||||||
|
* @param CommonObject $object commonobject
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setErrorsFromObject($object)
|
||||||
|
{
|
||||||
|
if (!empty($object->error)) {
|
||||||
|
$this->error = $object->error;
|
||||||
|
}
|
||||||
|
if (!empty($object->errors)) {
|
||||||
|
$this->errors = array_merge($this->errors, $object->errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTooltipContentArray
|
* getTooltipContentArray
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1672,7 +1672,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
|||||||
if (!array_key_exists($level, $logLevels)) {
|
if (!array_key_exists($level, $logLevels)) {
|
||||||
throw new Exception('Incorrect log level');
|
throw new Exception('Incorrect log level');
|
||||||
}
|
}
|
||||||
if ($level > $conf->global->SYSLOG_LEVEL) {
|
if ($level > getDolGlobalInt('SYSLOG_LEVEL')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user