xeraa/silverstripe-book

(page 223/224) $allowed_actions & RequiredFields

Closed this issue · 1 comments

$allowed_actions should also include the 'Form' action (the form will be submitted to /Form)

RequiredFields refers to the Field names/id's (which are capitalized eg. 'email' -> 'Email');

$validator = new RequiredFields(
'Email',
'Comment',
'FirstName',
'Surname'
);

Good spot, thanks! Added to the errata: https://github.com/xeraa/silverstripe-book/wiki/Home/f028a3f4d4e351121dc9fe0345dc2c5f5cc14560

Actually the code (https://github.com/xeraa/silverstripe-book/blob/master/chapter-08/mysite/code/ContactPage.php#L66) has been correct, not sure how I managed to get that into print ;-)