mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
N°6356 - Search, SELECT on class with a single field display the count and an empty list
This commit is contained in:
@@ -31,6 +31,8 @@ use DBObjectSet;
|
||||
use DeprecatedCallsLog;
|
||||
use Dict;
|
||||
use DisplayBlock;
|
||||
use IssueLog;
|
||||
use LogChannels;
|
||||
use MenuBlock;
|
||||
use MetaModel;
|
||||
use UserRights;
|
||||
@@ -388,6 +390,18 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
||||
}
|
||||
}
|
||||
|
||||
// N°6356 Check if there is at least 1 class remaining to display
|
||||
if (count($aLists) === 0) {
|
||||
IssueLog::Debug('Could not find any class / attribute to display in the list. Did you ensure the selected classes have the requested zlist? As a fallback, we will just display the friendlyname for the first selected class.', LogChannels::DATATABLE, [
|
||||
'selected_classes' => $aClassAliases,
|
||||
'zlist' => $sZListName,
|
||||
]);
|
||||
|
||||
$sFirstClassAlias = array_keys($aClassAliases)[0];
|
||||
$aAuthorizedClasses[$sFirstClassAlias] = $aClassAliases[$sFirstClassAlias];
|
||||
$aLists[$sFirstClassAlias] = [];
|
||||
}
|
||||
|
||||
$oDefaultSettings = DataTableSettings::GetDataModelSettings($aAuthorizedClasses, $bViewLink, $aLists);
|
||||
|
||||
$bDisplayLimit = isset($aExtraParams['display_limit']) ? $aExtraParams['display_limit'] : true;
|
||||
|
||||
Reference in New Issue
Block a user