From 49e03b009f72660f90235c464b346c387186ea72 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 27 Feb 2019 14:50:01 +0100 Subject: [PATCH 1/4] FIX : if empty error message, we just see "error" displayed --- htdocs/core/modules/mailings/xinputfile.modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 152322c2899..a026d4b53cf 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -179,7 +179,8 @@ class mailing_xinputfile extends MailingTargets { $i++; $langs->load("errors"); - $this->error = $langs->trans("ErrorFoundBadEmailInFile",$i,$cpt,$email); + $msg = $langs->trans("ErrorFoundBadEmailInFile",$i,$cpt,$email); + if(!empty($msg)) $this->error = $msg; } } } From 1237a6d3e9909d1b9b39c373d991c800f09621a0 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 27 Feb 2019 14:58:10 +0100 Subject: [PATCH 2/4] FIX : same thing here --- htdocs/core/modules/mailings/modules_mailings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 1a97f3502b7..9fb14fe1f1d 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -188,8 +188,8 @@ class MailingTargets // This can't be abstract as it is used for some method if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') { // Si erreur autre que doublon - dol_syslog($this->db->error()); - $this->error=$this->db->error(); + dol_syslog($this->db->error().' : '.$targetarray['email']); + $this->error=$this->db->error().' : '.$targetarray['email']; $this->db->rollback(); return -1; } From 85d46a5270198d12bb6e7a458ab71a9dcc47ff1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:24:07 +0100 Subject: [PATCH 3/4] Update xinputfile.modules.php --- htdocs/core/modules/mailings/xinputfile.modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index a026d4b53cf..e636c4885c7 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -180,7 +180,8 @@ class mailing_xinputfile extends MailingTargets $i++; $langs->load("errors"); $msg = $langs->trans("ErrorFoundBadEmailInFile",$i,$cpt,$email); - if(!empty($msg)) $this->error = $msg; + if (!empty($msg)) $this->error = $msg; + else $this->error = 'ErrorFoundBadEmailInFile '.$i.' '.$cpt.' '.$email; // We experience case where $langs->trans return an empty string. } } } From cefaeb583ff12ad09c836fcbf6b39d01209e901b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:24:43 +0100 Subject: [PATCH 4/4] Update xinputfile.modules.php --- htdocs/core/modules/mailings/xinputfile.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index e636c4885c7..1453f247d28 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -179,7 +179,7 @@ class mailing_xinputfile extends MailingTargets { $i++; $langs->load("errors"); - $msg = $langs->trans("ErrorFoundBadEmailInFile",$i,$cpt,$email); + $msg = $langs->trans("ErrorFoundBadEmailInFile", $i, $cpt, $email); if (!empty($msg)) $this->error = $msg; else $this->error = 'ErrorFoundBadEmailInFile '.$i.' '.$cpt.' '.$email; // We experience case where $langs->trans return an empty string. }