Yep.
I have actually tried downgrading to 2.4.1 and am getting the same problem. I don't think there is anything wrong with my code :s.
Here is my Page_Controller:
class Page_Controller extends ContentController {
public static $allowed_actions = array(
'guessForm'
);
public function init() {
parent::init();
...
}
public function guessForm() {
$fields = new FieldSet(
new TextField('Content','Any idea yet? Have a guess'),
new HiddenField('OwnerID', 'ID', $this->getPlayer()->ID)
);
$actions = new FieldSet(new FormAction("doSubmitGuess","Submit"));
$validator = new RequiredFields();
$validator->set_javascript_validation_handler('none');
return new Form($this,"guessForm",$fields,$actions,$validator);
}
public function doSubmitGuess($data,$form) {
$guess = new Guess();
$form->saveInto($guess);
$guess->write();
Director::redirectBack();
return;
}
}
I had already got the allowed actions entry. I have also written a unit test to sets saving of $guess and its associations, which pass. It just seems the form does not process the submit action :(.
I have also tried altering "Director::redirectBack();" with no luck.
Any ideas? This has me stumped. I don't think I am making some NOOB mistake, but I might be...
Mo