Merge pull request #23329 from grandoc/new_branch_24_12_2022

Warning: count(): Parameter must be an array or an object
This commit is contained in:
Laurent Destailleur 2022-12-26 23:39:44 +01:00 committed by GitHub
commit 94cd5da279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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 .= '<div id="dialogboxaction" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
$out .= '<table width=100%>';

View File

@ -1567,7 +1567,9 @@ function dol_meta_create($object)
}
if (is_dir($dir)) {
$nblines = count($object->lines);
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, '')."\"