From 5587d4375df7540cda4e170c33c018a7cfeb7c67 Mon Sep 17 00:00:00 2001
From: Damien <damien.burel@maarch.org>
Date: Fri, 28 Sep 2018 11:58:53 +0200
Subject: [PATCH] FIX #8400 Blank contact fusion if no contact

---
 modules/templates/datasources/letterbox_attachment.php | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/modules/templates/datasources/letterbox_attachment.php b/modules/templates/datasources/letterbox_attachment.php
index 6fdd52af0da..bea29474b3c 100755
--- a/modules/templates/datasources/letterbox_attachment.php
+++ b/modules/templates/datasources/letterbox_attachment.php
@@ -96,13 +96,6 @@ if (!empty($res_id)) {
             $stmt = $dbDatasource->query('SELECT firstname, lastname, user_id, mail, phone, initials FROM users WHERE user_id = ?', [$res_contact_id]);
             $myContact = $stmt->fetch(PDO::FETCH_ASSOC);
             $datasources['contact'][] = $myContact;
-        } else {
-            $stmt = $dbDatasource->query('SELECT * FROM view_contacts WHERE contact_id = ? and ca_id = ?', array($datasources['res_letterbox'][0]['contact_id'], $datasources['res_letterbox'][0]['address_id']));
-            $myContact = $stmt->fetch(PDO::FETCH_ASSOC);
-            $myContact['postal_address'] = \Contact\controllers\ContactController::formatContactAddressAfnor($myContact);
-            $myContact['contact_title'] = $contacts->get_civility_contact($myContact['contact_title']);
-            $myContact['title'] = $contacts->get_civility_contact($myContact['title']);
-            $datasources['contact'][] = $myContact;
         }
     
         if (isset($datasources['contact'][0]['title']) && $datasources['contact'][0]['title'] == '') {
-- 
GitLab