Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts: htdocs/cron/class/cronjob.class.php
This commit is contained in:
commit
7a69df08c5
@ -2553,7 +2553,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
if ($pictoisfullpath)
|
||||
{
|
||||
// Clean parameters
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
||||
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
|
||||
$fullpathpicto = $picto;
|
||||
}
|
||||
else
|
||||
@ -2575,7 +2575,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
|
||||
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
|
||||
// If alt path are defined, define url where img file is, according to physical path
|
||||
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
|
||||
{
|
||||
|
||||
@ -924,16 +924,16 @@ class Cronjob extends CommonObject
|
||||
// load classes
|
||||
if (! $error)
|
||||
{
|
||||
$ret=dol_include_once($this->classesname);
|
||||
if ($ret===false || (! class_exists($this->objectname)))
|
||||
{
|
||||
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||
$this->lastoutput = $this->error;
|
||||
$this->lastresult = -1;
|
||||
$retval = $this->lastresult;
|
||||
$error++;
|
||||
}
|
||||
$ret=dol_include_once($this->classesname);
|
||||
if ($ret===false || (! class_exists($this->objectname)))
|
||||
{
|
||||
$this->error=$langs->trans('CronCannotLoadClass',$this->classesname,$this->objectname);
|
||||
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
|
||||
$this->lastoutput = $this->error;
|
||||
$this->lastresult = -1;
|
||||
$retval = $this->lastresult;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// test if method exists
|
||||
@ -973,6 +973,7 @@ class Cronjob extends CommonObject
|
||||
$object = new $this->objectname($this->db);
|
||||
|
||||
$params_arr = array_map('trim', explode(",",$this->params));
|
||||
|
||||
if (!is_array($params_arr))
|
||||
{
|
||||
$result = call_user_func(array($object, $this->methodename), $this->params);
|
||||
@ -982,7 +983,7 @@ class Cronjob extends CommonObject
|
||||
$result = call_user_func_array(array($object, $this->methodename), $params_arr);
|
||||
}
|
||||
|
||||
if ($result===false || $result != 0)
|
||||
if ($result === false || (! is_bool($result) && $result != 0))
|
||||
{
|
||||
$langs->load("errors");
|
||||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$object->error, LOG_ERR);
|
||||
@ -1031,7 +1032,7 @@ class Cronjob extends CommonObject
|
||||
$result = call_user_func_array($this->methodename, $params_arr);
|
||||
}
|
||||
|
||||
if ($result === false || $result != 0)
|
||||
if ($result === false || (! is_bool($result) && $result != 0))
|
||||
{
|
||||
$langs->load("errors");
|
||||
dol_syslog(get_class($this)."::run_jobs result=".$result, LOG_ERR);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user