mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Merge pull request #75 from firebrandhq/1.3
Ensure compatibility with SS 3.7 & PHP 7.2
This commit is contained in:
commit
6a019d2594
5
_config.php
Normal file → Executable file
5
_config.php
Normal file → Executable file
@ -1,2 +1,7 @@
|
||||
<?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)
|
||||
if(!$currentStep || !$currentStep->ID) {
|
||||
$currentStep = Object::create($startStepClass);
|
||||
$currentStep = SS_Object::create($startStepClass);
|
||||
$currentStep->SessionID = $this->session->ID;
|
||||
$currentStep->write();
|
||||
$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
|
||||
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->write();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user