From 4c6caedbdac7003eb2731bdd516f5d3f18b279c6 Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Fri, 4 Jan 2019 15:00:14 +0100
Subject: [PATCH] FIX #9001 M2M get contact

---
 .../sendmail/Controllers/ReceiveMessageExchangeController.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/sendmail/Controllers/ReceiveMessageExchangeController.php b/modules/sendmail/Controllers/ReceiveMessageExchangeController.php
index 64ade710443..d1b50b88a1b 100755
--- a/modules/sendmail/Controllers/ReceiveMessageExchangeController.php
+++ b/modules/sendmail/Controllers/ReceiveMessageExchangeController.php
@@ -295,8 +295,8 @@ class ReceiveMessageExchangeController
             'limit'     => 1
         ]);
         if (!empty($contactAlreadyCreated)) {
-            $contact['contactId'] = $contactAlreadyCreated['contact_id'];
-            $contact['addressId'] = $contactAlreadyCreated['ca_id'];
+            $contact['contactId'] = $contactAlreadyCreated[0]['contact_id'];
+            $contact['addressId'] = $contactAlreadyCreated[0]['ca_id'];
         } else {
             $contact = ContactModel::CreateContactM2M(['data' => $aDataContact, 'contactCommunication' => $transferringAgencyMetadata->Communication[0]->value]);
         }
-- 
GitLab