N°3537 fix run_query asking value when using :current_contact

:current_contact is a magic arg and value is set by iTop ORM, so we shouldn't ask the user to provide it !

It was working as expected with :current_user

This is a 3.0.0 regression
This commit is contained in:
Pierre Goiffon
2021-01-15 12:05:53 +01:00
parent cd39d6a817
commit ec8a1af2a5

View File

@@ -4272,10 +4272,10 @@ abstract class MetaModel
}
if (count($aCurrentContact) > 0)
{
$oUser = MetaModel::GetObject("Person", UserRights::GetContactId(),true,true);
foreach ($aCurrentContact as $sField)
{
$aPlaceholders['current_contact->'.$sField] = $oUser->Get($sField);
$oPerson = MetaModel::GetObject("Person", UserRights::GetContactId(), true, true);
$aPlaceholders['current_contact->object()'] = $oPerson;
foreach ($aCurrentContact as $sField) {
$aPlaceholders['current_contact->'.$sField] = $oPerson->Get($sField);
}
}
}