Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » SilverStripe 2.4 Book Example Contact Page Error

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

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

Page: 1
Go to End
Author Topic: 545 Views
  • nzblue_fish
    Community Member
    13 Posts

    SilverStripe 2.4 Book Example Contact Page Error Link to this post

    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.

    Innes (NZ)

  • Willr
    Forum Moderator
    5508 Posts

    Re: SilverStripe 2.4 Book Example Contact Page Error Link to this post

    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/

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.