diff --git a/README b/README index 3412089..c80c925 100644 --- a/README +++ b/README @@ -12,9 +12,12 @@ Maintainer Contact Sean Harvey (Nickname: sharvey, halkyon) +Ingo Schommer (Nickname: chillu) + + Requirements ----------------------------------------------- -SilverStripe 2.2.2 or higher is required. +SilverStripe 2.4 or higher is required. Documentation ----------------------------------------------- diff --git a/code/MultiForm.php b/code/MultiForm.php index 0e1934e..c47695d 100644 --- a/code/MultiForm.php +++ b/code/MultiForm.php @@ -265,7 +265,7 @@ abstract class MultiForm extends Form { function getSavedSteps() { return DataObject::get( 'MultiFormStep', - sprintf("SessionID = '%s'", + sprintf("\"SessionID\" = '%s'", $this->session->ID ) ); @@ -442,7 +442,7 @@ abstract class MultiForm extends Form { } // Get the previous step of the class instance returned from $currentStep->getPreviousStep() - $prevStep = DataObject::get_one($prevStepClass, "SessionID = {$this->session->ID}"); + $prevStep = DataObject::get_one($prevStepClass, "\"SessionID\" = {$this->session->ID}"); // Set the current step as the previous step $this->setCurrentStep($prevStep); @@ -501,7 +501,7 @@ abstract class MultiForm extends Form { public function getAllStepsLinear() { $stepsFound = new DataObjectSet(); - $firstStep = DataObject::get_one($this->stat('start_step'), "SessionID = {$this->session->ID}"); + $firstStep = DataObject::get_one($this->stat('start_step'), "\"SessionID\" = {$this->session->ID}"); $templateData = array( 'ID' => $firstStep->ID, 'ClassName' => $firstStep->class, @@ -571,7 +571,7 @@ abstract class MultiForm extends Form { * @return int */ public function getCompletedStepCount() { - $steps = DataObject::get('MultiFormStep', "SessionID = {$this->session->ID} && Data IS NOT NULL"); + $steps = DataObject::get('MultiFormStep', "\"SessionID\" = {$this->session->ID} && \"Data\" IS NOT NULL"); return $steps ? $steps->Count() : 0; } diff --git a/code/MultiFormObjectDecorator.php b/code/MultiFormObjectDecorator.php index 8168d95..5685b5f 100644 --- a/code/MultiFormObjectDecorator.php +++ b/code/MultiFormObjectDecorator.php @@ -1,4 +1,4 @@ -where[0], "ID = ") !== 0 && !$this->wantsTemporary($query) ) { - $query->where[] = "`{$query->from[0]}`.`MultiFormIsTemporary` = 0"; + $query->where[] = "\"{$query->from[0]}\".\"MultiFormIsTemporary\" = 0"; } } @@ -49,11 +49,11 @@ class MultiFormObjectDecorator extends DataObjectDecorator { */ protected function wantsTemporary($query) { foreach($query->where as $whereClause) { - if($whereClause == "`{$query->from[0]}`.`MultiFormIsTemporary` = 1") return true; + if($whereClause == "\"{$query->from[0]}\".\"MultiFormIsTemporary\" = 1") return true; } return false; } -} +} ?> \ No newline at end of file diff --git a/code/MultiFormPurgeTask.php b/code/MultiFormPurgeTask.php index 0eca20e..0be745f 100644 --- a/code/MultiFormPurgeTask.php +++ b/code/MultiFormPurgeTask.php @@ -1,4 +1,4 @@ - " . self::$session_expiry_days + "DATEDIFF(NOW(), \"MultiFormSession\".\"Created\") > " . self::$session_expiry_days ); } -} +} ?> \ No newline at end of file diff --git a/code/MultiFormStep.php b/code/MultiFormStep.php index 8bba626..c5755b6 100644 --- a/code/MultiFormStep.php +++ b/code/MultiFormStep.php @@ -233,9 +233,9 @@ class MultiFormStep extends DataObject { if($this->SessionID && is_numeric($this->SessionID)) { $nextSteps = $this->stat('next_steps'); if(is_string($nextSteps)) { - return DataObject::get_one($nextSteps, "SessionID = {$this->SessionID}"); + return DataObject::get_one($nextSteps, "\"SessionID\" = {$this->SessionID}"); } elseif(is_array($nextSteps)) { - return DataObject::get_one($nextSteps[0], "SessionID = {$this->SessionID}"); + return DataObject::get_one($nextSteps[0], "\"SessionID\" = {$this->SessionID}"); } else { return false; } @@ -260,7 +260,7 @@ class MultiFormStep extends DataObject { * @return String Classname of a {@link MultiFormStep} subclass */ public function getPreviousStep() { - $steps = DataObject::get('MultiFormStep', "SessionID = {$this->SessionID}", 'LastEdited DESC'); + $steps = DataObject::get('MultiFormStep', "\"SessionID\" = {$this->SessionID}", '"LastEdited" DESC'); if($steps) { foreach($steps as $step) { if($step->getNextStep()) { @@ -281,7 +281,7 @@ class MultiFormStep extends DataObject { */ public function getPreviousStepFromDatabase() { if($prevStepClass = $this->getPreviousStep()) { - return DataObject::get_one($prevStepClass, "SessionID = {$this->SessionID}"); + return DataObject::get_one($prevStepClass, "\"SessionID\" = {$this->SessionID}"); } }