mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2889 - Fix error on attachment download due to $oObj not being a \cmdbAbstractObject
This commit is contained in:
@@ -284,7 +284,10 @@ class ormDocument
|
||||
if($sContentDisposition === static::ENUM_CONTENT_DISPOSITION_ATTACHMENT) {
|
||||
$oDocument->IncreaseDownloadsCount();
|
||||
$oObj->Set($sAttCode, $oDocument);
|
||||
$oObj->AllowWrite();
|
||||
// $oObj can be a \DBObject or \cmdbAbstractObject so we ahve to protect it
|
||||
if (method_exists($oObj, 'AllowWrite')) {
|
||||
$oObj->AllowWrite();
|
||||
}
|
||||
$oObj->DBUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user