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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

SilverStripe 2.4 Book Example Contact Page Error


Go to End


2 Posts   1421 Views

Avatar
nzblue_fish

Community Member, 13 Posts

19 January 2012 at 11:17am

Hi guys,

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.

Cheers,
Innes (NZ)

Avatar
Willr

Forum Moderator, 5523 Posts

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/