From ed15cde281b68a79ce618d3e96bc143fb8efbaad Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 18 Oct 2012 09:33:49 +0000 Subject: [PATCH] #583 Losing attachments when performing massive change SVN:trunk[2284] --- datamodels/1.x/itop-attachments/main.attachments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/datamodels/1.x/itop-attachments/main.attachments.php b/datamodels/1.x/itop-attachments/main.attachments.php index 7b79969ed..a5dd5647a 100644 --- a/datamodels/1.x/itop-attachments/main.attachments.php +++ b/datamodels/1.x/itop-attachments/main.attachments.php @@ -357,7 +357,7 @@ EOF $sMaxUpload = $this->GetMaxUpload(); $oPage->p(Dict::S('Attachments:AddAttachment').' '.$sMaxUpload); $oPage->p(''); - $oPage->p(''); + $oPage->p(''); $oPage->add(''); if ($this->m_bDeleteEnabled) { @@ -388,6 +388,12 @@ EOF protected static function UpdateAttachments($oObject, $oChange = null) { + if (utils::ReadParam('attachment_plugin', 'not-in-form') == 'not-in-form') + { + // Workaround to an issue in iTop < 2.0 + // Leave silently if there is no trace of the attachment form + return; + } $iTransactionId = utils::ReadParam('transaction_id', null); if (!is_null($iTransactionId)) {