From cd3122d597320c11d4ef37c71aecfcd87e4b5ba1 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Wed, 9 Sep 2015 13:38:52 +0000 Subject: [PATCH] #1144 Audit category having no rule -> PHP notices when showing the report + improved the behavior when the OQL of a rule is wrong. SVN:trunk[3742] --- pages/audit.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/audit.php b/pages/audit.php index e056788bf..71d49cb11 100644 --- a/pages/audit.php +++ b/pages/audit.php @@ -310,11 +310,10 @@ try } } $aResults[] = $aRow; - $iTotalErrors = count($aObjectsWithErrors); - $sOverallPercentOk = ($iCount == 0) ? '100.00' : sprintf('%.2f', 100.0 * (($iCount - $iTotalErrors) / $iCount)); - $sClass = GetReportColor($iCount, $iTotalErrors); - } + $iTotalErrors = count($aObjectsWithErrors); + $sOverallPercentOk = ($iCount == 0) ? '100.00' : sprintf('%.2f', 100.0 * (($iCount - $iTotalErrors) / $iCount)); + $sClass = GetReportColor($iCount, $iTotalErrors); } catch(Exception $e) { @@ -326,6 +325,10 @@ try $sMessage = Dict::Format('UI:Audit:ErrorIn_Category_Reason', $oAuditCategory->GetHyperlink(), $e->getMessage()); $oP->p(" ".$sMessage); $aResults[] = $aRow; + + $sClass = 'red'; + $iTotalErrors = 'n/a'; + $sOverallPercentOk = ''; } $oP->add("\n"); $oP->add("".$oAuditCategory->GetName()."$iCount$iTotalErrors$sOverallPercentOk %\n");