N°3907 - Polishing: Run query

This commit is contained in:
acognet
2021-08-02 18:56:07 +02:00
parent e28f704f3e
commit 3130e95f4f
5 changed files with 47 additions and 13 deletions

View File

@@ -403,7 +403,7 @@ class AjaxRenderController
while ($aObject = $oSet->FetchAssoc()) {
$aObj = [];
foreach ($aClassAliases as $sAlias => $sClass) {
if (isset($aObject[$sAlias])) {
if (isset($aObject[$sAlias]) && !is_null($aObject[$sAlias])) {
$aObj[$sAlias."/_key_"] = $aObject[$sAlias]->GetKey();
$aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink();
foreach ($aColumnsLoad[$sAlias] as $sAttCode) {
@@ -415,10 +415,14 @@ class AjaxRenderController
}
}
}
if ($sIdName != "") {
$aObj["id"] = $aObj[$sIdName];
}
if (isset($aObj)) {
if (isset($aObject)) {
if ($sIdName != "") {
if (isset($aObj[$sIdName])) {
$aObj["id"] = $aObj[$sIdName];
} else {
throw new Exception(Dict::Format('UI:Error:AnErrorOccuredWhileRunningTheQuery_Message', $oSet->GetFilter()->ToOQL()));
}
}
array_push($aResult["data"], $aObj);
}
}