Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Bug with $OnCompleteMessage in ReceivedFormSubmission.ss

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

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

Page: 1
Go to End
Author Topic: 1138 Views
  • Juanitou
    Avatar
    Community Member
    323 Posts

    Bug with $OnCompleteMessage in ReceivedFormSubmission.ss Link to this post

    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

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Bug with $OnCompleteMessage in ReceivedFormSubmission.ss Link to this post

    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

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Bug with $OnCompleteMessage in ReceivedFormSubmission.ss Link to this post

    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...

    1138 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.