Parameter must be array or object that implements Countable

warning with php 7.2
This commit is contained in:
Frédéric FRANCE 2019-06-06 09:49:32 +02:00 committed by GitHub
parent ab77051317
commit f11db8396a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -469,7 +469,7 @@ function actions_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id;
$listofresourcelinked = $resource->getElementResources($object->element, $object->id);
$nbResources=count($listofresourcelinked);
$nbResources=is_array($listofresourcelinked)?count($listofresourcelinked):0;
$head[$h][1] = $langs->trans("Resources");
if ($nbResources > 0) $head[$h][1].= ' <span class="badge">'.($nbResources).'</span>';
$head[$h][2] = 'resources';