浏览代码

Bug fix: when doing a bulk modify (or bulk apply stimulus) the external keys that were read-only in the edition form were displayed as "ClassName #id" instead of using their friendly name. This is now fixed, but requires a load of the target object.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1186 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 年之前
父节点
当前提交
9066d9a138
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      core/dbobject.class.php

+ 5 - 1
core/dbobject.class.php

@@ -524,7 +524,11 @@ abstract class DBObject
 		//
 		if (empty($sLabel))
 		{
-			$sLabel = MetaModel::GetName($sObjClass)." #$sObjKey";
+			// If the object if not issued from a query but constructed programmatically
+			// the label may be empty. In this case run a query to get the object's friendly name
+			$oTmpObj = MetaModel::GetObject($sObjClass, $sObjKey);
+			$sLabel = $oTmpObj->GetName();
+			//$sLabel = MetaModel::GetName($sObjClass)." #$sObjKey";
 		}
 		$sHint = MetaModel::GetName($sObjClass)."::$sObjKey";
 		return "<a href=\"{$sAbsoluteUrl}{$sPage}?operation=details&class=$sObjClass&id=$sObjKey&".$oAppContext->GetForLink()."\" title=\"$sHint\">$sLabel</a>";