3236 Posts in 942 Topics by 684 members
|Go to End|
15 August 2012 at 10:02am Last edited: 19 August 2012 10:59am
I'm new to silverstripe and I decided to try out Silverstripe 3. I created a basic registration form and everything worked in Silverstripe 2.4 but I get an error in Silverstripe 3. I probably missed something that needs to be changed to work in 3 but I haven't been able to find it so far.
Any help would be greatly appreciated
Here's the code:
class ArtistRegPage extends Page
static $db = array();
static $has_one = array();
class ArtistRegPage_Controller extends Page_Controller
$fields = new FieldList(
new TextField('FirstName','First Name'),
new TextField('Surname','Last Name'),
new EmailField('Email','Email Address'),
$actions = new FieldList(new FormAction('doArtistRegister','Submit'));
$validator = new RequiredFields('FirstName', 'SurName', 'Email', 'Password');
$form = new Form(
function doArtistRegister($data, $form)
$artist = new Artist();
$form->sessionMessage('Form successfully submitted', 'Good');
Note: It works fine if comment out $artist->write(). Also the same problem occurs if I use Member instead of Artist.
17 August 2012 at 8:19pm
What is the error message you get?
18 August 2012 at 9:33am
I did some more tracking down of the error and found out it was a validation error. I was using an existing email address. I will need to read up more on validation to make sure the error is correctly reported to the user.
|Go to Top|