DMXzone Mailer Support Product Page

Solved

The each() function is deprecated: php 7.2

Reported 26 Feb 2019 17:44:04
1
has this problem
26 Feb 2019 17:44:04 Firdaus Rohman posted:
I got this error on console and function is not being executed when using php 7.2+.

{code: 0, file: "C:\...\dmxConnectLib\lib\mail\MimePart.php", line: 285,…}
code: 0
file: "C:\...\dmxConnectLib\lib\mail\MimePart.php"
line: 285
message: "The each() function is deprecated. This message will be suppressed on further calls"

Replies

Replied 26 Feb 2019 18:35:31
26 Feb 2019 18:35:31 Firdaus Rohman replied:
So I updated the code to

foreach ($lines as $line) {}

not sure if that's correct and all I need to amend, but the mail function seems working fine now with php 7.2.

Let me know should there's proper step for it.
Replied 27 Feb 2019 08:10:19
27 Feb 2019 08:10:19 Teodor Kuduschiev replied:
Hello,
this will be fixed in the next update.
Replied 23 Mar 2020 15:09:58
23 Mar 2020 15:09:58 David Woolley replied:
Was this fixed in DMXzone Mailer? I'm getting the exact same 500 internal server error in Chrome Dev Tools when the form is submitted using PHP 7.2

dmxConnectLib/lib/mail/MimePart.php
line: 285:
The each() function is deprecated ...

If Debug mode from Server Connect is ON, then it gives another error:

serverconnectForm.js:174 POST www.afrocelticsporrans.com/dmxConnect/api/form-mailer.php 500 (Internal Server Error)
_submit @ serverconnectForm.js:174
submit @ app.js:69
onsubmit @ form.js:32

I can't find the JS file it is referring to in the site files, or any reference to this file when I search all files in the site.
serverconnectForm.js

All fine when I revert back to PHP 7.1

I tried reinstalling DMXzone Mailer in DMXzone Ext Manager, but no change.
Replied 23 Mar 2020 15:29:48
23 Mar 2020 15:29:48 Teodor Kuduschiev replied:
Well yes, this has been fixed long time ago.
And you are not looking at the right debug info. You need to follow www.dmxzone.com/go/32354/debugging-problems-in-dmxzone-server-connect/

It's not a js file the error is in...

As usual - remove the dmxConnectLib folder locally. Open ANY server action and SAVE it. The folder will be recreated locally. Upload the newly generated dmxConnectLib folder to the server and the error will be fixed.
Replied 23 Mar 2020 17:09:49
23 Mar 2020 17:09:49 David Woolley replied:
Sure Teodor - I've used the SC debug mode many times before to troubleshoot.

I was just wondering where serverconnectForm.js fitted in to the scheme of things.

I did run debug mode ON and got the same error and explanation about the each() function deprecated as Firdaus above, but did not want repeat everything he had said.

Sorry it is not apparent to me that I should have removed the dmxConnectLib folder locally.
I've done exactly as you suggest above, but still get this error:

{code: 0, file: "/usr/..... /dmxConnectLib/lib/mail/MimePart.php", line: 285,…}
1. code: 0
2. file: "/usr/..... /dmxConnectLib/lib/mail/MimePart.php"
3. line: 285
4. message: "The each() function is deprecated. This message will be suppressed on further calls"
5. trace: too long to include here ...
Replied 23 Mar 2020 17:57:31
23 Mar 2020 17:57:31 Teodor Kuduschiev replied:
Looks like you still have the old file on the server.
Please make sure to install the latest versions of Server Connect and the Mailer in your DW, then repeat the procedure i explained above. It's already been an year since this has been fixed.
Replied 23 Mar 2020 19:34:18
23 Mar 2020 19:34:18 David Woolley replied:
Thanks Teodor

All working now - the original MimePart.php was still on the server.

The newer MimePart.php now has line 285 fixed:

foreach ($lines as $line){


This confused me no end as I have several other sites that use Mailer with PHP 7.2 and all working fine.

Reply to this topic