From 57a0e2d47e1bafc76f253b883ae016ea6290bc01 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 17 Jan 2011 15:13:28 +0000 Subject: [PATCH] Fixed Trac #345: hidden or read-only parameters in a form were not taken into account for computing the allowed values. SVN:trunk[1050] --- application/cmdbabstract.class.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 68423c6f4..d1872461e 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1317,9 +1317,12 @@ EOF else { $iFlags = $this->GetAttributeFlags($sAttCode); + $sInputId = $this->m_iFormId.'_'.$sAttCode; if ($iFlags & OPT_ATT_HIDDEN) { - // Attribute is hidden, do nothing + // Attribute is hidden, add a hidden input + $oPage->add(''); + $aFieldsMap[$sAttCode] = $sInputId; } else { @@ -1327,13 +1330,14 @@ EOF { // Attribute is read-only $sHTMLValue = $this->GetAsHTML($sAttCode); + $sHTMLValue .= ''; + $aFieldsMap[$sAttCode] = $sInputId; } else { $sValue = $this->Get($sAttCode); $sDisplayValue = $this->GetEditValue($sAttCode); $aArgs = array('this' => $this, 'formPrefix' => $sPrefix); - $sInputId = $this->m_iFormId.'_'.$sAttCode; $sHTMLValue = "".self::GetFormElementForField($oPage, $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', $iFlags, $aArgs).''; $aFieldsMap[$sAttCode] = $sInputId;