Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

e-mail validation doesn't work under php 5.6 #87

Closed pawelmil closed 7 years ago

pawelmil commented 8 years ago

e-mail validation doesn't work under php 5.6 (works under php 5.3) My environment: MODX 2.4.3, Formit 2.2.10pl, apache, php v.5.6

joeke commented 8 years ago

Hi @pawelmil, Can't seem to reproduce this issue.. We almost always use the email validator on our forms, and with different server setups (php 5.4, 5.6, php7) and it always works. Maybe if you try debug the form by removing all the other fields and hooks, for example: [[!FormIt? &hooks=spam &validate=email:email` ]]

[[+fi.error.email]]
` See if above example still fails to validate. Also check your MODX error log for FormIt errors.
pawelmil commented 8 years ago

Thank You. Your form validates, but if I want to use email hook, it only works under php 5.3. It can't send email when I use php 5.6

bwente commented 7 years ago

Has anyone else had this issue? We upgraded to MODX 2.5.2 and PHP 5.6 and the FormIt CMP is not displaying previous submitted forms or submitting forms that save to DB.

pawelmil commented 7 years ago

When I use email hook in formit call, I get error in modx error log: [2017-08-17 17:03:27] (ERROR @ /home/admin/domains/xyz.pl/public_html/core/components/formit/model/formit/fihooks.class.php : 580) [FormIt] Wystąpił błąd przy wysyłaniu wiadomości. SMTP Connect() zakończone niepowodzeniem. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting I checked it at modx 2.5.7. Error occurs under php 5,6 or above

pawelmil commented 7 years ago

[2017-08-17 17:17:14] (ERROR @ /home/admin/domains/domain.pl/public_html/core/components/formit/model/formit/fihooks.class.php : 580) [FormIt] Wystąpił błąd przy wysyłaniu wiadomości. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting [2017-08-17 17:17:17] (ERROR @ /home/admin/domains/domain.pl/public_html/core/model/modx/mail/phpmailer/class.smtp.php : 369) PHP warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed [2017-08-17 17:17:18] (ERROR @ /home/admin/domains/domain.pl/public_html/core/components/formit/model/formit/fihooks.class.php : 580) [FormIt] Wystąpił błąd przy wysyłaniu wiadomości. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

joeke commented 7 years ago

This seems like an issue with the internal MODX phpmailer installation. It looks like your php 5.6 installation isn't setup correctly.. Could you test this by using the modMail service inside a snippet? Something like:

$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(modMail::MAIL_BODY, 'My test message');
$modx->mail->set(modMail::MAIL_SUBJECT, 'My test subject');
$modx->mail->address('to', 'email@domain.com', 'your name');
$modx->mail->send();

If above code fails, then it's not a FormIt problem, but some other problem in your setup.

pawelmil commented 7 years ago

This snippet fails under php 5.6 and above. ThankYou.