From 25331ce13e29ed9901bf0ce0bf5194b53ad19d67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Aug 2024 02:45:26 +0200 Subject: [PATCH] Fix cursor --- htdocs/emailcollector/class/emailcollector.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 54f7f743127..ca4adaefdc5 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1658,13 +1658,10 @@ class EmailCollector extends CommonObject $richarrayofemail = array(); - $iforemailloop = 0; foreach ($arrayofemail as $imapemail) { if ($nbemailprocessed > 1000) { break; // Do not process more than 1000 email per launch (this is a different protection than maxnbcollectedpercollect) } - $iforemailloop++; - // GET header and overview datas if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP')) { @@ -1691,7 +1688,10 @@ class EmailCollector extends CommonObject $richarrayofemail = dol_sort_array($richarrayofemail, 'date', 'asc'); + $iforemailloop = 0; foreach ($richarrayofemail as $tmpval) { + $iforemailloop++; + $imapemail = $tmpval['imapemail']; $header = $tmpval['header']; $overview = $tmpval['overview'];