PHP 7.2 compatibility: count(null) now generates a PHP warning !!

SVN:trunk[5815]
This commit is contained in:
Denis Flaven
2018-05-28 14:08:31 +00:00
parent 04e41ab676
commit 6cc4a6e1be
4 changed files with 7 additions and 6 deletions

View File

@@ -2367,7 +2367,7 @@ EOF
else
{
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
if (count($aAllowedValues) == 1)
if (is_array($aAllowedValues) && (count($aAllowedValues) == 1))
{
$aValues = array_keys($aAllowedValues);
$oObj->Set($sAttCode, $aValues[0]);
@@ -3461,7 +3461,7 @@ EOF
foreach (MetaModel::EnumPlugins('iApplicationObjectExtension') as $oExtensionInstance)
{
$aNewIssues = $oExtensionInstance->OnCheckToWrite($this);
if (count($aNewIssues) > 0)
if (is_array($aNewIssues) && (count($aNewIssues) > 0)) // Some extensions return null instead of an empty array
{
$this->m_aCheckIssues = array_merge($this->m_aCheckIssues, $aNewIssues);
}