In a bit of serendipity, I found that our SPForm contact form had stopped working. Because it had been working so reliably, we hadn't tested it for a long time, so I'm not sure when it stopped working, but I believe the problem is related to the recent upgrade to MODX Revo 2.4.1.
As long as I'm logged in to the Manager, it works perfectly, both with its default properties and with the custom property sheet that turns on Captcha with the math problem and allows the reset button to appear. However, when I log out and test it, it fails with this error message:
"Unauthorized Access in spformproc"
I have already tried uninstalling, completely removing, and reinstalling SPForm from a fresh download.
I have tested the mailing function (using SMTP -- same as SPForm) with QuickEmail, and it works flawlessly.
I have tried setting the &warnAll, &spfDebug, and &adviseAll settings to 1, but AFAICT, everything looked normal.
Bob, what else do I need to do to get this fixed? Could it be caused by corruption in the MySQL db (which turned out to be the cause of an inability to update plugins following the 2.4.1 upgrade), and if so, where in the db should I look?
Thanks in advance.
As far as I can tell, only two things would cause that.
1. The emailsender System Setting is empty or less than 5 characters long.
2. There's a problem with $_SESSIONS causing the $_SESSION['include_auth'] variable to be missing or incorrect.
Let's hope it's the first one.
If you don't have one of the two sections in .htaccess that force www or non-www URLs uncommented, that could cause the $_SESSION problem.
Well -- it's not 1. emailsender is set to a known working email address over 5 characters.
Checking on 2.
I'm glad you got it sorted. Thanks for reporting the fix.
Hi sorry to bother.
Is there a way to just add one extra field to an spform? I have a couple of sites just needing a "Phone Number" box - it seems a fair bit of extra trouble setting up FormIt... SpForm works great and is lovely and simple so I'd rather stick with it if there is any way to just have an extra field?
Thanks for any help.
SPForm was designed to be a quick and easy contact form. I assumed that only people who were not up to using FormIt would be using it. I should have made it easier to add fields when I refactored it for Revolution (long, long ago when I was fairly new to MODX and PHP). The code is, frankly, embarrassing. SPForm doesn't even use a Tpl chunk for the message.
The only option would be to add an input named 'phone' (name="phone") to the spform TPl chunk and add a line of code to the core\components\spform\model\spform\spformprocclass.inc.php file to put it in the message. It would go just after line 379. Just above this line:
$this->_content .= preg_replace('/\r/', '', stripslashes($_POST['comments']));
The code would be something like this:
$this->_content .= '<br />Phone: ' . stripslashes($_POST['phone']) . '<br />';
I'm sorry it isn't easier.
Check the &formProcAllowedReferers property of the snippet tag. Make sure it includes your server (yoursite.com,www.yoursite.com).
Also, check the emailsender System Setting and make sure it's an address at your own server.