From df51c0ea519e8a22e5769ad83adbcf9621c957a3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sat, 15 Oct 2022 13:07:07 +0200 Subject: [PATCH 1/2] Fix php 8 error --- htdocs/datapolicy/class/datapolicycron.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 965d93754f7..13e31581f76 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -451,8 +451,8 @@ class DataPolicyCron $this->db->begin(); foreach ($arrayofparameters as $key => $params) { - if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) { - $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); + if (getDolGlobalInt($key) != '' && is_numeric(getDolGlobalInt($key)) && (int) getDolGlobalInt($key) > 0) { + $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql); From 7c615fafb914507843364ca326106924c759d498 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Oct 2022 23:14:33 +0200 Subject: [PATCH 2/2] Update datapolicycron.class.php --- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 13e31581f76..c357fbe7d15 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -451,7 +451,7 @@ class DataPolicyCron $this->db->begin(); foreach ($arrayofparameters as $key => $params) { - if (getDolGlobalInt($key) != '' && is_numeric(getDolGlobalInt($key)) && (int) getDolGlobalInt($key) > 0) { + if (getDolGlobalInt($key) > 0) { $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql);