Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Bug with $OnCompleteMessage in ReceivedFormSubmission.ss


Go to End


3 Posts   1651 Views

Avatar
Juanitou

Community Member, 323 Posts

16 October 2008 at 4:55am

Edited: 16/10/2008 4:56am

Hi!

If I follow the instructions of the third tutorial and create a ReceivedFormSubmission.ss template in mysite/templates/, containing only $OnCompleteMessage, when I execute the form the server goes nuts (error 500 in a remote one, halt on local WAMPServer).

If I delete ReceivedFormSubmission.ss and I restart the server, the form is correctly executed, the mail is sent and the OnCompleteMessage appears in the browser.

If I create a ReceivedFormSubmission.ss containing something as <p>Test</p>, the form is correctly executed, the mail is sent and 'Test' appears in the browser.

Tested with three different projects/databases.

I hope it's something that happens only in special cases or beginners will get mad! BTW, this tutorial should be rewritten, since it does not explain many UserDefinedForm features. On the other hand, I understand that these forms are being moved to a different module.

Sorry about my English.

Regards,
Juanitou

Avatar
Juanitou

Community Member, 323 Posts

16 October 2008 at 2:01pm

Edited: 17/10/2008 1:21am

UPDATE:

The form work on localhost (the recommended WAMPServer) if I do not use ReceivedFormSubmission.ss but in the remote server I still have the 500 error.

If I uncheck 'Email form on submit:' the fields are correctly submitted to the database and the OnComplete message is shown, so I expect to being able to collect these fields and send them by a simple email() call.

Any ideas on how to resolve this problem?

Regards,
Juanitou

Avatar
Juanitou

Community Member, 323 Posts

19 October 2008 at 3:46am

Edited: 19/10/2008 3:47am

I have somewhat resolved the problem by hacking UserDefinedForm.php in order to not use UserDefinedForm_SubmittedFormEmail class, and providing a template not named SubmittedFormEmail. Believe me or not, but just changing the name (not the code) from SubmittedFormEmail to ContactFormEmail resolved the error 500 problem.

That's too strange...