HTTPS?: Form submission is not possible #6877
Unanswered
InTerestedOWL
asked this question in
Troubleshooting
Replies: 1 comment 12 replies
-
Can you show your config/statamic/sites.php file? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I am currently building a website with statamic.
I am now facing some issues regarding the use of https and the form submission:
For explanation I have a lokal environment and a live environment on a server.
My problem is the following: While I can submit the form on the local environment, my live environment reports me a fatal PHP Error which I can't really understand:
I am not new to the game. I looked after the reason:
And found the FormController.php line 51 which is causing the issue:
$this->withLocale($site->lang(), function () use ($fields) {
Checked the $site variable it is obvious in line 34 that there is something wrong. I debugged a bit:
$site = Site::findByUrl(URL::previous());
While URL::previous() returns the previous page, which behaves as expected.
But Site::findByUrl() returns null. Which is the problem..
Since css and co was not loaded in the control panel via https. I added URL::forceSchema('https'); to the web.php channel. Maybe this is a fault?
Beta Was this translation helpful? Give feedback.
All reactions