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
|
||||
$steps = $this->FormSteps();
|
||||
if($steps) foreach($steps as $step) {
|
||||
$steps->remove($step); // @TODO not sure if this is required (does delete() remove the relation too?)
|
||||
$step->destroy();
|
||||
$step->delete();
|
||||
if($step && $step->exists()) {
|
||||
$steps->remove($step);
|
||||
$step->delete();
|
||||
$step->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
parent::onBeforeDelete();
|
||||
|
Loading…
Reference in New Issue
Block a user