Kaynağa Gözat

CustomFields: suppressed a warning when editing an object with a custom field being read-only

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3976 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 yıl önce
ebeveyn
işleme
fd1ae9f09a
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      application/cmdbabstract.class.inc.php

+ 6 - 1
application/cmdbabstract.class.inc.php

@@ -657,7 +657,12 @@ EOF
 
 											// Attribute is read-only
 											$sHTMLValue = "<span id=\"field_{$sInputId}\">".$this->GetAsHTML($sAttCode);
-											$sHTMLValue .= '<input type="hidden" id="'.$sInputId.'" name="attr_'.$sPrefix.$sAttCode.'" value="'.htmlentities($this->Get($sAttCode), ENT_QUOTES, 'UTF-8').'"/></span>';
+											$value = $this->Get($sAttCode);
+											if (is_object($value))
+											{
+												$value = '';
+											}
+											$sHTMLValue .= '<input type="hidden" id="'.$sInputId.'" name="attr_'.$sPrefix.$sAttCode.'" value="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"/></span>';
 											$aFieldsMap[$sAttCode] = $sInputId;
 											$sComments = $sSynchroIcon;
 										}