瀏覽代碼

#1074 Portal: errors when selecting Impact/Urgency, and if the user has access to his organization only.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3686 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 年之前
父節點
當前提交
f2e9851667
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      application/wizardhelper.class.inc.php

+ 10 - 2
application/wizardhelper.class.inc.php

@@ -113,8 +113,16 @@ class WizardHelper
 				{
 					// For external keys: load the target object so that external fields
 					// get filled too
-					$oTargetObj = MetaModel::GetObject($oAttDef->GetTargetClass(), $value);
-					$oObj->Set($sAttCode, $oTargetObj);
+					$oTargetObj = MetaModel::GetObject($oAttDef->GetTargetClass(), $value, false);
+					if ($oTargetObj)
+					{
+						$oObj->Set($sAttCode, $oTargetObj);
+					}
+					else
+					{
+						// May happen for security reasons (portal, see ticket #1074)
+						$oObj->Set($sAttCode, $value);
+					}
 				}
 				else
 				{