N°6077 - Attachment class: now creation_date and user_id are init by default (#339)

Those fields were empty in case the Attachment instance was created in an extension (Mail to Ticket for example).

Now the values are set in the object DBInsertNoReload method : 
* creation_date : current date
* user_id : current user

The previous values set for console and portal are removed.

A fix for Mail to Ticket extension is also planned : N°4081.
This commit is contained in:
Pierre Goiffon
2023-03-08 16:34:32 +01:00
committed by GitHub
parent 559f5b4bdb
commit 69beb05a55
3 changed files with 14 additions and 4 deletions

View File

@@ -1230,8 +1230,6 @@ class ObjectController extends BrickController
$oAttachment->Set('expire', time() + MetaModel::GetConfig()->Get('draft_attachments_lifetime')); // one hour...
$oAttachment->Set('temp_id', $sTempId);
$oAttachment->Set('item_class', $sObjectClass);
$oAttachment->Set('creation_date', time());
$oAttachment->Set('user_id', UserRights::GetUserObject());
$oAttachment->SetDefaultOrgId();
$oAttachment->Set('contents', $oDocument);
$iAttId = $oAttachment->DBInsert();