I just upgraded a site from 3.5.11 to 6.2.4 and have added an email contact form after installing the Email module. When I submit the form I get the following error:
It happens each time the form is submitted and there is no other error information.
Any help would be appreciated.
Thank you.
have you tried copying over the system/ee
folder from the 6.2.4 files again to ensure that all files are copied correctly?
also, can you post your email contact form from your template? I’d like to test setting that up in 3.5.11 and then upgrade to see if I can replicate the issue.
Hi Andy,
Thanks for the response. This form is new with the upgrade. I was using Freeform with the 3.5.11 install. However, here is my form. I will re upload the system/ee folder to see if that helps. I’ll let you know. I look forward to your response. Note: I am using the reCapthca plugin for the captcha function.
{exp:email:contact_form
user_recipients="no"
recipients="fake@email.com"
replyto="yes"
redirect="5"
return="contact/thank-you"
form:id="contact_us"
}
<label for="full_name">*Name</label>
<input type="text" name="full_name" id="full_name" value="" /><br >
<label for="from">*Email</label>
<input type="text" name="from" id="from" value="" /><br >
<label for="user_message">*Message</label>
<textarea name="user_message" id="user_message"></textarea>
{captcha}
<input name="submit" type='submit' class="submit-home" value="Submit" />
{/exp:email:contact_form}
ok. The only issue I ran into using your form is that user_message
needs to be just message
to work with the native contact form. ( https://docs.expressionengine.com/latest/add-ons/email.html#message-1 ). Once I update that name parameter, the form submitted without issue. This was using the native Captcha. Do you have a link to which reCaptcha add-on you are using?
thanks
I changed user_message to message and removed the {captcha} and still get the same error.
Here is the link: https://devot-ee.com/add-ons/recaptcha-v2
Also, to take the problem form off the home page, I moved it here to work on while I sort out the issues:
https://camclinic.com/contact/
My form now looks like this:
<label for="name">*Name</label>
<input type="text" name="name" id="name" value="" /><br >
<label for="from">*Email</label>
<input type="text" name="from" id="from" value="" /><br >
<label for="message">*Message</label>
<textarea name="message" id="message"></textarea>
{captcha}
<input name="submit" type='submit' class="submit-home" value="Submit" />
Is that correct?
Yep fields look correct now. Might be a good idea to use a proper email input type and add “required” parameters:
<label for="name">*Name</label>
<input type="text" name="name" id="name" value="" required><br >
<label for="from">*Email</label>
<input type="email" name="from" id="from" value="" required><br >
<label for="message">*Message</label>
<textarea name="message" id="message" required></textarea>
{captcha}
<input name="submit" type='submit' class="submit-home" value="Submit" />
Basically, the error means that ee()->load->library('session');
isn’t being loaded somewhere it should have been loaded. Most likely an error is being thrown and not being caught, but it’s preventing the class from loading. Unfortunately, this is one of those things that could be caused by a number of things. If you want to deep dive, you can step debug this with something like XDebug and see what’s being called when the error is thrown.
Since we know the native contact form works with the native captcha, then it would seem that something 3rd party is causing this. Possibly an add-on that’s not fully compatible with EE6.
Here are some more steps to look at:
Thank you to all who replied. Fortunately, we have a happy ending and I’ll share the results.
Thanks to Andy for turning off the extensions. This isolated the reCaptcha plugin as the culprit.
Thanks to Rob for helping me get the form right - third times the charm
To vw000 Freeform Express does work with EE 6.2.4, but I needed a more robust Captcha option so I opted for the email:contact_form option because integrating reCaptcha v3 is a no-brainer.
Everything is working now and I appreciate everyone’s thoughtful input.
I also received spam using the default EE form. I dislike reCAPTCHA with passion, and it’s also at privacy foul as it’s sending your visitors’ traffic information to Google.
You might look into hCaptcha if you need a quick replacement and even earn some cents 😊
I use the default EE captcha and I solved the spam in the most ridiculous way. I load the code from a different template in an iframe, contact page only works if JavaScript is enabled. From 3 spams per day, it’s now 0 for a year or more.
Since most bots actually only hit the form URL directly they cannot load the code as most have JS disabled and as such they are never able to post the form as no code shows.
And does that do have JS enabled, as they hit the URL POST directly they are not actually loading the iframe that has the code, which against invalids their submission. It only works if you actually load the page from the browser. It drives them crazy. 😁😁😁 I killed spam completely, no complex captcha required, just the simple nice build in that comes with EE and is easy to solve.
And still works fine for those with JS disabled as they see the code on the iframe. Stupid solution, but it works. I never had a single spam on the default EE form. At least hCaptcha rewards the website, and you can donate the money to charities.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.