From 799b6a972565f11afd17713b6851276352252252 Mon Sep 17 00:00:00 2001 From: Vladimir Kunin Date: Tue, 14 Mar 2023 18:44:16 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B06104=20-=20Fix=20exception=20thrown=20if?= =?UTF-8?q?=20'item=5Fclass'=20has=20'org=5Fid'=20attcode=20mapped=20to=20?= =?UTF-8?q?another=20attcode=20(#311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2.x/itop-attachments/datamodel.itop-attachments.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml b/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml index 20eba9948..0994fa17f 100755 --- a/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml +++ b/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml @@ -192,18 +192,18 @@ $aCallSpec = array($sClass, 'MapContextParam'); if (is_callable($aCallSpec)) { - $sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter + $sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter if (MetaModel::IsValidAttCode($sClass, $sAttCode)) { // Second: check that the organization CAN be fetched from the current user // if (MetaModel::IsValidClass('Person')) { - $aCallSpec = array($sClass, 'MapContextParam'); + $aCallSpec = array('Person', 'MapContextParam'); if (is_callable($aCallSpec)) { - $sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter - if (MetaModel::IsValidAttCode($sClass, $sAttCode)) + $sAttCode = call_user_func($aCallSpec, 'org_id'); // Returns null when there is no mapping for this parameter + if (MetaModel::IsValidAttCode('Person', $sAttCode)) { // OK - try it //