From d3a0ad068705328a6957621a5569ce10617690fa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:29:23 +0100 Subject: [PATCH 1/3] Warning: count(): Parameter must be an array or an object --- htdocs/core/boxes/box_actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index fb0f93086d2..ac0df03184a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -220,7 +220,9 @@ class box_actions extends ModeleBoxes if (!empty($conf->global->SHOW_DIALOG_HOMEPAGE)) { $actioncejour = false; $contents = $this->info_box_contents; - $nblines = count($contents); + if (is_countable($contents) && count($contents) > 0) { + $nblines = count($contents); + } if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) { $out .= '
trans("ActionsToDo").'">'; $out .= ''; From 344c241970a7f0d5012e383750bed8b3cb30a472 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:37:36 +0100 Subject: [PATCH 2/3] Warning: count(): Parameter must be an array or an object --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ae4afc695e6..77375200bc4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1567,7 +1567,9 @@ function dol_meta_create($object) } if (is_dir($dir)) { + if (is_countable($object->lines) && count($object->lines) > 0) { $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\" From 6df6f786df35cb6ab5c94faa739eea2c183f5f8c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 24 Dec 2022 14:38:11 +0000 Subject: [PATCH 3/3] Fixing style errors. --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 77375200bc4..452d0ca4bb5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1568,8 +1568,8 @@ function dol_meta_create($object) if (is_dir($dir)) { if (is_countable($object->lines) && count($object->lines) > 0) { - $nblines = count($object->lines); - } + $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\"