Avoid scalar values in OQL, replace them with variables

This commit is contained in:
Eric
2019-01-02 16:14:58 +01:00
parent 6c9850b8f6
commit a9bd5a8bb0
4 changed files with 22 additions and 19 deletions

View File

@@ -1428,12 +1428,13 @@ class ObjectController extends AbstractController
// Building the search
$bIgnoreSilos = $oApp['scope_validator']->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass);
$oSearch = DBObjectSearch::FromOQL("SELECT " . $sObjectClass . " WHERE id IN ('" . implode("','", $aObjectIds) . "')");
$aParams = array('objects_id' => $aObjectIds);
$oSearch = DBObjectSearch::FromOQL("SELECT $sObjectClass WHERE id IN (:objects_id)");
if ($bIgnoreSilos === true)
{
$oSearch->AllowAllData();
}
$oSet = new DBObjectSet($oSearch);
$oSet = new DBObjectSet($oSearch, array(), $aParams);
$oSet->OptimizeColumnLoad($aObjectAttCodes);
// Retrieving objects