From 93a1f027cb0dcebfbeaa845a28ebe947cae7c9ac Mon Sep 17 00:00:00 2001 From: acognet Date: Wed, 21 Apr 2021 09:16:09 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02922=20-=20Dependent=20fields=20in=20Req?= =?UTF-8?q?uest=20template=20-=20Error=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/attributedef.class.inc.php | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index d405aa133..0ddf603d4 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1,24 +1,10 @@ GetCode() : $sFormPrefix.'_cf_'.$this->GetCode(); $oHandler->BuildForm($oHostObject, $sFormId); $oForm = $oHandler->GetForm(); - } catch (Exception $e) - { + } catch (Exception $e) { $oForm = new \Combodo\iTop\Form\Form(''); - $oField = new LabelField(''); - $oField->SetLabel('Custom field error: '.$e->getMessage()); + $oField = new \Combodo\iTop\Form\Field\StringField(''); + $oField->SetReadOnly(true); + $oField->SetLabel('Custom field error: '); + $oField->SetCurrentValue($e->getMessage()); $oForm->AddField($oField); $oForm->Finalize(); }