Commit 6689eadf authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic
Browse files

Bug 1812910: Importer needs to use is_array() before count() in PHP 7.2

When we are wanting to check if there is an array to foreach loop over
and that array has at least one entry.

Currently we try to loop over entries by checking with just count() and we get error
- count(): Parameter must be an array or an object that implements Countable


Change-Id: I9accca2e97f415d5f9a2203b6fd984a41e95a4d0
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
(cherry picked from commit 9b3e36e2)
parent 7e4c8d8d
{if count($entryannotations)}
{if is_array($entryannotations) && count($entryannotations)}
<div class="section-import">
<h2>{str tag=Annotation section=artefact.annotation}</h2>
{foreach from=$entryannotations item=annotation}
{if count($entryfiles)}
{if is_array($entryfiles) && count($entryfiles)}
<div class="section-import">
<h2>{str tag=file section=artefact.file}</h2>
{foreach from=$entryfiles item=file}
......@@ -2,7 +2,7 @@
<h2>{str tag=profile section=artefact.internal}</h2>
<div class="form-group collapsible-group">
{foreach from=$profilegroups item=profilegroup name='profilegroup'}
{if count($profilegroup.fields)}
{if is_array($profilegroup.fields) && count($profilegroup.fields)}
<fieldset id="{$}_fs" class="pieform-fieldset collapsible {if $dwoo.foreach.profilegroups.last} last{/if}">
......@@ -14,7 +14,7 @@
<div id="profilefield-{$}" class="collapse list-group">
{foreach from=$profilegroup.fields key=fieldname item=fieldvalues}
{if count($fieldvalues)}
{if is_array($fieldvalues) && count($fieldvalues)}
<div id="profile-{$}" class="fieldset-body">
<h5 class="profilefield list-group-item-heading">
{str tag=$fieldname section=artefact.internal}
......@@ -2,7 +2,7 @@
<h2>{str tag=resume section=artefact.resume}</h2>
<div class="form-group collapsible-group">
{foreach from=$resumegroups item=resumegroup}
{if count($resumegroup.fields)}
{if is_array($resumegroup.fields) && count($resumegroup.fields)}
<fieldset id="{$}_fs" class="pieform-fieldset collapsible">
......@@ -14,7 +14,7 @@
<div id="resumefield-{$}" class="collapse list-group">
{foreach from=$resumegroup.fields key=fieldname item=fieldvalues}
{if count(fieldvalues)}
{if is_array($fieldvalues) && count($fieldvalues)}
<div id="resume-{$}" class="list-group-item">
<h5 class="resumefield" class="list-group-item-heading">
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment