From 0a2edaec3e510a1699a6c5c13b9de0bcc323fcfe Mon Sep 17 00:00:00 2001
From: Nestor <npegane@hotmail.com>
Date: Fri, 27 Apr 2018 17:45:26 +0200
Subject: [PATCH] FIX #5409 renamed wrong variable

---
 modules/attachments/attachments_content.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/attachments/attachments_content.php b/modules/attachments/attachments_content.php
index 332f0dff1fc..bc6d2d22d1f 100755
--- a/modules/attachments/attachments_content.php
+++ b/modules/attachments/attachments_content.php
@@ -1221,9 +1221,9 @@ if (isset($_REQUEST['id'])) {
 
     //On recherche le type de document attaché à ce courrier
     $stmt = $db->query('SELECT type_id, creation_date FROM res_letterbox WHERE res_id = ?', array($_SESSION['doc_id']));
-    $type_id = $stmt->fetchObject();
-    $type_id = $type_id->type_id;
-    $dataForDate = $type_id->creation_date;
+    $mail_doctype = $stmt->fetchObject();
+    $type_id = $mail_doctype->type_id;
+    $dataForDate = $mail_doctype->creation_date;
     //On recherche le sve_type
     $stmt = $db->query('SELECT * FROM mlb_doctype_ext WHERE type_id = ?', array($type_id));
     $sve = $stmt->fetchObject();
-- 
GitLab