mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°2272 Fix call to DBObjectSet::OptimizeColumnLoad() in the portal (doesn't support "id" attribute anymore)
This commit is contained in:
@@ -1231,12 +1231,6 @@ class ObjectController extends BrickController
|
||||
throw new HttpException(Response::HTTP_INTERNAL_SERVER_ERROR, 'Invalid request data, some information are missing');
|
||||
}
|
||||
|
||||
// Checking that id is in the AttCodes
|
||||
if (!in_array('id', $aObjectAttCodes))
|
||||
{
|
||||
$aObjectAttCodes = array_merge(array('id'), $aObjectAttCodes);
|
||||
}
|
||||
|
||||
// Building the search
|
||||
$bIgnoreSilos = $oScopeValidator->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass);
|
||||
$aParams = array('objects_id' => $aObjectIds);
|
||||
@@ -1248,6 +1242,13 @@ class ObjectController extends BrickController
|
||||
$oSet = new DBObjectSet($oSearch, array(), $aParams);
|
||||
$oSet->OptimizeColumnLoad(array($oSearch->GetClassAlias() => $aObjectAttCodes));
|
||||
|
||||
// Checking that id is in the AttCodes
|
||||
// Note: We do that AFTER the array is used in OptimizeColumnLoad() because the function doesn't support this anymore.
|
||||
if (!in_array('id', $aObjectAttCodes))
|
||||
{
|
||||
$aObjectAttCodes = array_merge(array('id'), $aObjectAttCodes);
|
||||
}
|
||||
|
||||
// Retrieving objects
|
||||
while ($oObject = $oSet->Fetch())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user