22398 Posts in 6744 Topics by 2749 members
|Go to End|
19 January 2012 at 11:17am
Not sure where to ask this question, but thought this was as good a place to start as any.
I've been using the PACKT Pub book SilverStripe 2.4 Module Extension, Themes, and Widgets to get me started with SS.
I was using the example Contact Form code as the basis for a Contact Page in my first project. When I tried my form for the first time the server returned an "unknown page error" when the form was submitted to .../contact-us/Form
After a bit of diagnosis I came to the conclusion that the $allowed_actions given in the book example prevented the form submission from occurring (well at least that's what I discovered).
In the ContactPage controller the $allowed_actions is defined as: array('sent') but this seems to prevent the form from submitting correctly. Changing the allowed_actions to include 'Form' gets things working correctly.
Has anyone else tried to build the Contact Form example (page 223) and got it working exactly as documented?
BTW I did correct the missing apostrophe in the ContactPage Model definition.
20 January 2012 at 4:00pm
Might want to email the author directly. And yes you'll need the form function name as an allowed_action. So it's either a bug in the book or 2.4.6 has changed in some way. I believe there is an errata section on github to include the most up to date code - https://github.com/xeraa/silverstripe-book/
|Go to Top|