Hi Will,
tks for the reply.
I am trying to see if I can debug that, perhaps you can help me a little.
I am looking at the MultiForm class's "actions_exempt_from_validation" feature, at approx. line 130:
if( $actionNames ) {
foreach( $actionNames as $exemptAction) {
if(!empty($_REQUEST[$exemptAction])) {
$applyValidation = false;
break;
}
}
}
It appears the code tries to check a match with exempted actions (e.g. action_prev) with the request object, but inspecting the $_REQUEST object only returns the multiformsessionid and not the posted action submit button!
Then, I tried to inspect if the posted submit button is available via
$currentStep->loadData();
But this only returns the form fields' data, excluding the submit action.
I see no other location where the submit action is inspected in the code, does that mean I have to look into the Silverstripe base Form class?
Also, I find it quite strange that the validation exemption is performed at __construct(), is it to exclude js validation code being injected? Shouldn't it be handled in httpSubmission() instead? Since we "do" want validation if, instead of hitting the "back", we hit the "next".
Does the __construct() here doubles as the handler for submission from the last form step?
If so, i find it more puzzling that the "current" step validation now depends on the posted action from the previous step
(the lines from 130 till "parent::__construct($controller, $name, $fields, $actions, $validator);")