diff --git a/pages/ajax.render.php b/pages/ajax.render.php index cca3d3031..663f7bd39 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -2157,6 +2157,7 @@ EOF if ($sExpression === null) { $oQuerySearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $iQueryId)); + $oQuerySearch->UpdateContextFromUser(); $oQueries = new DBObjectSet($oQuerySearch); if ($oQueries->Count() > 0) { @@ -2171,6 +2172,7 @@ EOF if($sExpression !== null) { $oSearch = DBObjectSearch::FromOQL($sExpression); + $oSearch->UpdateContextFromUser(); $oExporter = BulkExport::FindExporter($sFormat, $oSearch); $oExporter->SetObjectList($oSearch); $oExporter->SetFormat($sFormat); diff --git a/webservices/export-v2.php b/webservices/export-v2.php index b58ee36df..157eec5ab 100644 --- a/webservices/export-v2.php +++ b/webservices/export-v2.php @@ -137,6 +137,7 @@ function DisplayExpressionForm(WebPage $oP, $sAction, $sExpression = '', $sExcep $oP->add(''); $oExportSearch = DBObjectSearch::FromOQL($sExpression); + $oExportSearch->UpdateContextFromUser(); } else { $oQuery = MetaModel::GetObject('QueryOQL', $sQueryId); $oExportSearch = DBObjectSearch::FromOQL($oQuery->Get('oql')); + $oExportSearch->UpdateContextFromUser(); $oP->add(''); } $aFormPartsByFormat = array(); @@ -379,6 +383,7 @@ EOF if ($sQueryId !== null) { $oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId)); + $oSearch->UpdateContextFromUser(); $oQueries = new DBObjectSet($oSearch); if ($oQueries->Count() > 0) { @@ -406,6 +411,7 @@ EOF } } } + if ($sFormat !== null) { @@ -458,7 +464,8 @@ function CheckParameters($sExpression, $sQueryId, $sFormat) if ($sExpression === null) { $oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId)); - $oQueries = new DBObjectSet($oSearch); + $oSearch->UpdateContextFromUser(); + $oQueries = new DBObjectSet($oSearch); if ($oQueries->Count() > 0) { $oQuery = $oQueries->Fetch(); @@ -478,6 +485,7 @@ function CheckParameters($sExpression, $sQueryId, $sFormat) try { $oSearch = DBObjectSearch::FromOQL($sExpression); + $oSearch->UpdateContextFromUser(); $aArgs = array(); foreach($oSearch->GetQueryParams() as $sParam => $foo) { @@ -608,6 +616,7 @@ if (utils::IsModeCLI()) if ($sExpression === null) { $oSearch = DBObjectSearch::FromOQL('SELECT QueryOQL WHERE id = :query_id', array('query_id' => $sQueryId)); + $oSearch->UpdateContextFromUser(); $oQueries = new DBObjectSet($oSearch); if ($oQueries->Count() > 0) { @@ -622,6 +631,7 @@ if (utils::IsModeCLI()) try { $oSearch = DBObjectSearch::FromOQL($sExpression); + $oSearch->UpdateContextFromUser(); $aArgs = array(); foreach($oSearch->GetQueryParams() as $sParam => $foo) {