mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
N°5900 - DB integrity analysis crashes when too many errors - limit the results to 100 to avoid memory errors
This commit is contained in:
@@ -207,9 +207,13 @@ function DisplayErrorList($aResults)
|
||||
|
||||
foreach ($aResults as $sClass => $aErrorList) {
|
||||
foreach ($aErrorList as $sErrorLabel => $aError) {
|
||||
$iCount = $aError['count'];
|
||||
if ($iCount === DatabaseAnalyzer::LIMIT) {
|
||||
$iCount = "$iCount(+)";
|
||||
}
|
||||
$aRows[] = [
|
||||
'class' => MetaModel::GetName($sClass).' ('.$sClass.')',
|
||||
'count' => $aError['count'],
|
||||
'count' => $iCount,
|
||||
'error' => $sErrorLabel,
|
||||
];
|
||||
}
|
||||
@@ -227,10 +231,19 @@ function DisplayErrorDetails($aResults, $bVerbose)
|
||||
|
||||
foreach ($aResults as $sClass => $aErrorList) {
|
||||
foreach ($aErrorList as $sErrorLabel => $aError) {
|
||||
$sErrorTitle = Dict::Format('DBTools:DetailedErrorTitle', MetaModel::GetName($sClass).' ('.$sClass.')', $aError['count'], $sErrorLabel);
|
||||
$iCount = $aError['count'];
|
||||
if ($iCount === DatabaseAnalyzer::LIMIT) {
|
||||
$iCount = "$iCount(+)";
|
||||
}
|
||||
$sErrorTitle = Dict::Format('DBTools:DetailedErrorTitle', MetaModel::GetName($sClass).' ('.$sClass.')', $iCount, $sErrorLabel);
|
||||
$oCollapsible = CollapsibleSectionUIBlockFactory::MakeStandard($sErrorTitle);
|
||||
$oBlock->AddSubBlock($oCollapsible);
|
||||
|
||||
if ($aError['count'] === DatabaseAnalyzer::LIMIT) {
|
||||
$oHTML = new Combodo\iTop\Application\UI\Base\Component\Html\Html('<p>'.Dict::format('DBTools:DetailedErrorLimit', DatabaseAnalyzer::LIMIT).'</p>');
|
||||
$oCollapsible->AddSubBlock($oHTML);
|
||||
}
|
||||
|
||||
$oFieldSet = FieldSetUIBlockFactory::MakeStandard(Dict::S('DBTools:SQLquery'));
|
||||
$oCollapsible->AddSubBlock($oFieldSet);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user