diff --git a/application/wizardhelper.class.inc.php b/application/wizardhelper.class.inc.php index b6eb2927b..14e61ea5c 100644 --- a/application/wizardhelper.class.inc.php +++ b/application/wizardhelper.class.inc.php @@ -198,7 +198,15 @@ class WizardHelper public function GetIdForField($sFieldName) { - return $this->m_aData['m_oFieldsMap'][$sFieldName]; + $sResult = ''; + // It may happen that the field we'd like to update does not + // exist in the form. For example, if the field should be hidden/read-only + // in the current state of the object + if (isset($this->m_aData['m_oFieldsMap'][$sFieldName])) + { + $sResult = $this->m_aData['m_oFieldsMap'][$sFieldName]; + } + return $sResult; } static function ParseJsonSet($oMe, $sLinkClass, $sExtKeyToMe, $sJsonSet) diff --git a/business/KEDB.business.php b/business/KEDB.business.php index 5edf8a823..8a04bc432 100644 --- a/business/KEDB.business.php +++ b/business/KEDB.business.php @@ -95,8 +95,7 @@ class lnkInfraError extends cmdbAbstractObject } -if (false) -{ + //////////////////////////////////////////////////////////////////////////////////// /** * n-n link between any Contract and a Document @@ -131,6 +130,5 @@ class lnkDocumentError extends cmdbAbstractObject MetaModel::Init_SetZListItems('list', array('doc_id', 'error_name', 'link_type')); // Attributes to be displayed for a list } } -} ?> diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 44738b110..2ea114bfd 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1268,7 +1268,7 @@ class AttributeDateTime extends AttributeDBField } // Init static constant once for all (remove when PHP allows real static const) -AttributeDate::InitStatics(); +AttributeDateTime::InitStatics(); /** diff --git a/js/jquery.popupmenu.js b/js/jquery.popupmenu.js index dbdabb5d1..fe27e70f7 100644 --- a/js/jquery.popupmenu.js +++ b/js/jquery.popupmenu.js @@ -18,7 +18,6 @@ jQuery.fn.popupmenu = function () { $(this).bind('mouseenter.popup_menu click.popup_menu', function (evt) { - console.log(evt.type); var previous_popup = popupmenu; var bMenuClosed = false; popupmenu = $(this).find('ul'); diff --git a/pages/ajax.render.php b/pages/ajax.render.php index a3d1e8e2d..58380c3ad 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -88,12 +88,18 @@ switch($operation) foreach($oWizardHelper->GetFieldsForAllowedValues() as $sAttCode) { $sId = $oWizardHelper->GetIdForField($sAttCode); - $value = $oObj->Get($sAttCode); - $displayValue = $oObj->GetEditValue($sAttCode); - $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode); - $sHTMLValue = cmdbAbstractObject::GetFormElementForField($oPage, $sClass, $sAttCode, $oAttDef, $value, $displayValue, $sId, '', 0, array('this' => $oObj)); - - $oWizardHelper->SetAllowedValuesHtml($sAttCode, $sHTMLValue); + if ($sId != '') + { + // It may happen that the field we'd like to update does not + // exist in the form. For example, if the field should be hidden/read-only + // in the current state of the object + $value = $oObj->Get($sAttCode); + $displayValue = $oObj->GetEditValue($sAttCode); + $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode); + $sHTMLValue = cmdbAbstractObject::GetFormElementForField($oPage, $sClass, $sAttCode, $oAttDef, $value, $displayValue, $sId, '', 0, array('this' => $oObj)); + + $oWizardHelper->SetAllowedValuesHtml($sAttCode, $sHTMLValue); + } } $oPage->add("\n"); break;