From 46358b6e368f2386682c4feb7a1e2496ada15ca1 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 10 Dec 2019 10:59:00 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B01982=20-=20Fix=20resolution=20date=20not?= =?UTF-8?q?=20updated=20as=20expected=20when=20concurrent=20access=20from?= =?UTF-8?q?=20both=20portal=20and=20admin.=20console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portal/src/Form/ObjectFormManager.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index 8929645813..6c315426cf 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -16,8 +16,6 @@ * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * - * */ namespace Combodo\iTop\Portal\Form; @@ -956,7 +954,12 @@ class ObjectFormManager extends FormManager $oField->SetDisplayMode($aFieldsExtraData[$sAttCode]['display_mode']); } - $oForm->AddField($oField); + // Do not add hidden fields as they are of no use, if one is necessary because another depends on it, it will be automatically added. + // Note: We do this at the end because during the process an hidden field could have become writable if mandatory and empty for example. + if($oField->GetHidden() === false) + { + $oForm->AddField($oField); + } } // Checking dependencies to ensure that all needed fields are in the form