🐛 N°8522 - check if org id is null when filtering (#727)

This commit is contained in:
Håkon Harnes
2025-09-22 16:51:32 +02:00
committed by GitHub
parent f3deb8be11
commit 03e1d46586
2 changed files with 92 additions and 1 deletions

View File

@@ -142,7 +142,9 @@ abstract class UserRightsAddOnAPI
$oFilter = new DBObjectSearch($sClass);
$oListExpr = ListExpression::FromScalars($aAllowedOrgs);
$oCondition = new BinaryExpression($oExpression, 'IN', $oListExpr);
$oNullCondition = new FunctionExpression('ISNULL', [$oExpression]);
$oInCondition = new BinaryExpression($oExpression, 'IN', $oListExpr);
$oCondition = $oNullCondition->LogOr($oInCondition);
$oFilter->AddConditionExpression($oCondition);
if ($this->HasSharing())