fix: php warning in BOM admin and modulebuilder template (#34437)

This commit is contained in:
HENRY Florian
2025-06-13 17:19:30 +02:00
committed by GitHub
parent 2187a5c8a5
commit 181f8367a7
3 changed files with 5 additions and 5 deletions

View File

@@ -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] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
}
@@ -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] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
}