From ec8a1af2a54d794eb1bdd15f004c7861a855fd85 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 15 Jan 2021 12:05:53 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03537=20fix=20run=5Fquery=20asking=20valu?= =?UTF-8?q?e=20when=20using=20:current=5Fcontact=20:current=5Fcontact=20is?= =?UTF-8?q?=20a=20magic=20arg=20and=20value=20is=20set=20by=20iTop=20ORM,?= =?UTF-8?q?=20so=20we=20shouldn't=20ask=20the=20user=20to=20provide=20it?= =?UTF-8?q?=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was working as expected with :current_user This is a 3.0.0 regression --- core/metamodel.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index a5ae960c0..f8878661f 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -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); } } }