From 98a2c35ab51cfe42ad6aed43fd1976026fd7f82c Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:51:06 +0200 Subject: [PATCH 1/2] PHP V8 warning error, use of not declared array --- htdocs/core/modules/DolibarrModules.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 3b7cc0d1184..2d5b62ae3f9 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1263,7 +1263,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if (is_array($this->boxes)) { foreach ($this->boxes as $key => $value) { //$titre = $this->boxes[$key][0]; - $file = $this->boxes[$key]['file']; + if (empty($this->boxes[$key]['file'])) { + $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility + } else + $file = $this->boxes[$key]['file']; + //$note = $this->boxes[$key][2]; // TODO If the box is also included by another module and the other module is still on, we should not remove it. @@ -1276,10 +1280,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } - if (empty($file)) { - $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility - } - if ($this->db->type == 'sqlite3') { // sqlite doesn't support "USING" syntax. // TODO: remove this dependency. From f0f8210918e68d15e1b1017642d242e5eab9f0a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 19:28:26 +0200 Subject: [PATCH 2/2] Update DolibarrModules.class.php --- htdocs/core/modules/DolibarrModules.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 2d5b62ae3f9..ab0e3c8508a 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1265,9 +1265,10 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it //$titre = $this->boxes[$key][0]; if (empty($this->boxes[$key]['file'])) { $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility - } else + } else { $file = $this->boxes[$key]['file']; - + } + //$note = $this->boxes[$key][2]; // TODO If the box is also included by another module and the other module is still on, we should not remove it.