mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
BUGFIX If the step doesn't exist, don't attempt to delete it
This commit is contained in:
parent
3690de6943
commit
04130ad501
@ -55,9 +55,11 @@ class MultiFormSession extends DataObject {
|
|||||||
// delete dependent form steps and relation
|
// delete dependent form steps and relation
|
||||||
$steps = $this->FormSteps();
|
$steps = $this->FormSteps();
|
||||||
if($steps) foreach($steps as $step) {
|
if($steps) foreach($steps as $step) {
|
||||||
$steps->remove($step); // @TODO not sure if this is required (does delete() remove the relation too?)
|
if($step && $step->exists()) {
|
||||||
$step->destroy();
|
$steps->remove($step);
|
||||||
$step->delete();
|
$step->delete();
|
||||||
|
$step->destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::onBeforeDelete();
|
parent::onBeforeDelete();
|
||||||
|
Loading…
Reference in New Issue
Block a user