diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 57828cfc798..4c5e0cff24e 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -49,7 +49,7 @@ function bomAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT."/admin/bom_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['bom_bom']['label']) ? count($extrafields->attributes['bom_bom']['label']) : 0; + $nbExtrafields = (isset($extrafields->attributes['bom_bom']['label']) && is_countable($extrafields->attributes['bom_bom']['label'])) ? count($extrafields->attributes['bom_bom']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= '' . $nbExtrafields . ''; } @@ -58,7 +58,7 @@ function bomAdminPrepareHead() $head[$h][0] = DOL_URL_ROOT."/admin/bomline_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $nbExtrafields = is_countable($extrafields->attributes['bom_bomline']['label']) ? count($extrafields->attributes['bom_bomline']['label']) : 0; + $nbExtrafields = (isset($extrafields->attributes['bom_bomline']['label']) && is_countable($extrafields->attributes['bom_bomline']['label'])) ? count($extrafields->attributes['bom_bomline']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= '' . $nbExtrafields . ''; } diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index e03a8b962a2..8e1b911fd66 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -47,7 +47,7 @@ function mymoduleAdminPrepareHead() /* $head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtraFields"); - $nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0; + $nbExtrafields = (isset($extrafields->attributes['myobject']['label']) && is_countable($extrafields->attributes['myobject']['label'])) ? count($extrafields->attributes['myobject']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= '' . $nbExtrafields . ''; } @@ -56,7 +56,7 @@ function mymoduleAdminPrepareHead() $head[$h][0] = dol_buildpath("/mymodule/admin/myobjectline_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $nbExtrafields = is_countable($extrafields->attributes['myobjectline']['label']) ? count($extrafields->attributes['myobject']['label']) : 0; + $nbExtrafields = (isset($extrafields->attributes['myobjectline']['label']) && is_countable($extrafields->attributes['myobjectline']['label'])) ? count($extrafields->attributes['myobject']['label']) : 0; if ($nbExtrafields > 0) { $head[$h][1] .= '' . $nbExtrafields . ''; } diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index c22eefe06cd..9be39ce0b08 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -248,7 +248,7 @@ if ($action == 'create') { print ''; print '