From 891b22909a41a88c5084bcbe89342d9873d32ebf Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 18 Oct 2012 09:39:37 +0000 Subject: [PATCH] #583 Losing attachments when performing massive change SVN:1.2[2286] --- modules/itop-attachments/model.attachments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/itop-attachments/model.attachments.php b/modules/itop-attachments/model.attachments.php index 8b6835624..8389fca3e 100644 --- a/modules/itop-attachments/model.attachments.php +++ b/modules/itop-attachments/model.attachments.php @@ -468,7 +468,7 @@ EOF $oPage->p(Dict::S('Attachments:AddAttachment').' '.$sMaxUpload); //$oPage->p(''); $oPage->p(''); - $oPage->p(''); + $oPage->p(''); $oPage->add(''); if ($this->m_bDeleteEnabled) { @@ -499,6 +499,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)) {