mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 09:05:49 +00:00
Ensure compatibility with SS 3.7 & PHP 7.2
This commit is contained in:
parent
e8fc4fca46
commit
ef12c37ca7
5
_config.php
Normal file → Executable file
5
_config.php
Normal file → Executable file
@ -1,2 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Ensure compatibility with PHP 7.2 ("object" is a reserved word),
|
||||||
|
// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object)
|
||||||
|
if (!class_exists('SS_Object')) {
|
||||||
|
class_alias('Object', 'SS_Object');
|
||||||
|
}
|
4
code/model/MultiForm.php
Normal file → Executable file
4
code/model/MultiForm.php
Normal file → Executable file
@ -221,7 +221,7 @@ abstract class MultiForm extends Form {
|
|||||||
|
|
||||||
// Always fall back to creating a new step (in case the session or request data is invalid)
|
// Always fall back to creating a new step (in case the session or request data is invalid)
|
||||||
if(!$currentStep || !$currentStep->ID) {
|
if(!$currentStep || !$currentStep->ID) {
|
||||||
$currentStep = Object::create($startStepClass);
|
$currentStep = SS_Object::create($startStepClass);
|
||||||
$currentStep->SessionID = $this->session->ID;
|
$currentStep->SessionID = $this->session->ID;
|
||||||
$currentStep->write();
|
$currentStep->write();
|
||||||
$this->session->CurrentStepID = $currentStep->ID;
|
$this->session->CurrentStepID = $currentStep->ID;
|
||||||
@ -483,7 +483,7 @@ abstract class MultiForm extends Form {
|
|||||||
|
|
||||||
// Determine whether we can use a step already in the DB, or have to create a new one
|
// Determine whether we can use a step already in the DB, or have to create a new one
|
||||||
if(!$nextStep = DataObject::get_one($nextStepClass, "\"SessionID\" = {$this->session->ID}")) {
|
if(!$nextStep = DataObject::get_one($nextStepClass, "\"SessionID\" = {$this->session->ID}")) {
|
||||||
$nextStep = Object::create($nextStepClass);
|
$nextStep = SS_Object::create($nextStepClass);
|
||||||
$nextStep->SessionID = $this->session->ID;
|
$nextStep->SessionID = $this->session->ID;
|
||||||
$nextStep->write();
|
$nextStep->write();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user