diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index f4bd5f9e9..3983fa08b 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1299,6 +1299,14 @@ class AttributeDashboard extends AttributeDefinition { return ''; } + + /** + * @inheritdoc + */ + public function MakeFormField(DBObject $oObject, $oFormField = null) + { + return null; + } } /** diff --git a/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php b/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php index 88a7be0f8..5997e5bda 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php +++ b/datamodels/2.x/itop-portal-base/portal/src/forms/objectformmanager.class.inc.php @@ -600,13 +600,17 @@ class ObjectFormManager extends FormManager foreach ($aFieldsAtts as $sAttCode => $iFieldFlags) { $oAttDef = MetaModel::GetAttributeDef(get_class($this->oObject), $sAttCode); - - // Failsafe for AttributeType that would not have MakeFormField and therefore could not be used in a form + + /** @var Field $oField */ + $oField = null; if (is_callable(get_class($oAttDef) . '::MakeFormField')) { - /** @var Field $oField */ $oField = $oAttDef->MakeFormField($this->oObject); - + } + + // Failsafe for AttributeType that would not have MakeFormField and therefore could not be used in a form + if($oField !== null) + { if ($this->sMode !== static::ENUM_MODE_VIEW) { // Field dependencies @@ -816,7 +820,7 @@ class ObjectFormManager extends FormManager $oField = new LabelField($sAttCode); $oField->SetReadOnly(true) ->SetHidden(false) - ->SetCurrentValue(get_class($oAttDef) . ' : Sorry, that AttributeType is not implemented yet.') + ->SetCurrentValue('Sorry, that AttributeType is not implemented yet.') ->SetLabel($oAttDef->GetLabel()); }