Error message returned by old non "addreplace" hooks is propagated too
This commit is contained in:
parent
d6628a87a9
commit
e2934a6b5f
@ -267,6 +267,12 @@ class HookManager
|
|||||||
|
|
||||||
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray=array_merge($this->resArray, $actionclassinstance->results);
|
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray=array_merge($this->resArray, $actionclassinstance->results);
|
||||||
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
|
||||||
|
if (is_numeric($resaction) && $resaction < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
|
||||||
|
dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error)?'':" ".$this->error).(empty($this->errors)?'':" ".join(",",$this->errors)), LOG_ERR);
|
||||||
|
}
|
||||||
// TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string but an int. you must use $actionclassinstance->resprints to return a string
|
// TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string but an int. you must use $actionclassinstance->resprints to return a string
|
||||||
if (! is_array($resaction) && ! is_numeric($resaction))
|
if (! is_array($resaction) && ! is_numeric($resaction))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user