Skip to content

Commit

Permalink
Merge pull request #54 from spekulatius/removing_GET
Browse files Browse the repository at this point in the history
Removing get
  • Loading branch information
Damian Mooyman committed Dec 13, 2015
2 parents c99711d + 15f4bd0 commit 4d027d2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions code/model/MultiForm.php
Expand Up @@ -54,6 +54,7 @@ abstract class MultiForm extends Form {
* @var string
*/
private static $get_var = 'MultiFormSessionID';

/**
* These fields are ignored when saving the raw form data into session.
* This ensures only field data is saved, and nothing else that's useless
Expand Down Expand Up @@ -205,9 +206,15 @@ public function getCurrentStep() {

// Determine whether we use the current step, or create one if it doesn't exist
$currentStep = null;
if(isset($_GET['StepID'])) {
$stepID = (int)$_GET['StepID'];
$currentStep = DataObject::get_one('MultiFormStep', "\"SessionID\" = {$this->session->ID} AND \"ID\" = {$stepID}");
$StepID = $this->controller->request->getVar('StepID');
if(isset($StepID)) {
$currentStep = DataObject::get_one(
'MultiFormStep',
array(
'SessionID' => $this->session->ID,
'ID' => $StepID
)
);
} elseif($this->session->CurrentStepID) {
$currentStep = $this->session->CurrentStep();
}
Expand Down

0 comments on commit 4d027d2

Please sign in to comment.