New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 400 by sending #94
Comments
I use yout plugin in many projects, there everything works just fine. In the project i get this error i build the forms the same way then in the projects where everything is just working fine. This is the code from the form:
|
That error means your Request is not a POST, so maybe a redirect is happening?, like Apache .htaccess redirecting before the submission makes it through? Because I tested the form on an Ubuntu 14.10 server and it worked correctly. |
I'm getting a
|
I believe these are Craft CSRF errors. I don't use Craft for complex Projects (I use Laravel) so I don't have much experience with many of Craft's nuances. I apologize I can't be of much help. But a quick google search lead me here. BTW, I came to the conclusion it's Craft's error, because your trace doesn't even make it into the |
Thanks for the quick response. Yes, it seems like it works when CSRF is disabled. I'll bring up with issue with the folks at Craft. Thanks! |
@jayhlee I've just run into this too. Could you point me in the direction of the discussion with Craft so I can keep up to date with it? |
@tyssen I actually haven't followed up on this issue yet with the good people at Craft, but it seems like this is the thread that's most germane to the issue at hand. https://github.com/craftcms/cms/issues/3330 I just disabled CSRF for now to get things to work. I'll actually post something on that thread right now. |
@jayhlee I saw @brandonkelly response, I will take a deeper look at it. |
@jayhlee @tyssen @wedot Can you guys confirm that you tested what Brandon says in the thread? Here about Chrome causing problems and trying it out with different browsers? specially if testing on Localhost, or same URL using SSL? I just want to make sure All the necessary testing steps are done before moving forward, because I just tested on my Ubuntu server and it works correctly. I tried both Regular Post Submission and AJAX submission. |
I released a new patch version that improves
|
In the Time since the error I found out why it don't work out in my case. I had a turned on the browser cache via htacsess. This was it:
I removed it for now. Plus I installed the Plugin No-Cache and wraped it around the form. For now it works out fine. I've tested to send the form with ajax and with post. |
hmm most likely it was caching the CSRF Token. That's something that gets refreshed every time a submission happens. |
Probably. The strange thing is that I've used this method for quite a while. It does work in other Craft 3 installations I have not updated until now. |
@xpertbot It does seem like the issue had to do with caching. When I removed the |
There's something we can do about this actually, That way you don't have to pollute your Craft with Plugins. There is a Yii2 (That's the framework behind Craft) JS call that can refresh the CSRF Token when the page is loaded, so in this case. You cache the whole page including the Javascript but when the cached page gets loaded the Javascript refreshes the CSRF Token on the form. That waythe form Works correctly. I will take a look at how to implement this maybe with a configuration call on the |
So I have been trying to solve this problem the past couple of days and the
I will have to come up with some clever way to include the Javascript into the template so it gets cached. |
Added new configuration options to
Because of the nature of the Let me know if you have any questions. P.S. This is on the development branch and will be under testing before I deploy it next week. |
Hello
I'm using your form plugin on meany pages. It is a cool plugin thx for your work.
At the moment i have a problem with the plugin by sending. I allways get this error:
I'm not sure how to fix that.
The text was updated successfully, but these errors were encountered: