Fix on delete summit
Change-Id: I231a32ef831e3c1a3877a7ad1be73d67d098e71e
This commit is contained in:
parent
08e644a434
commit
a9a4819623
@ -779,6 +779,7 @@ class SummitEvent extends SilverstripeBaseModel
|
||||
*/
|
||||
public function deleted($args){
|
||||
|
||||
if($this->summit->isDeleting()) return;
|
||||
Event::fire(new SummitEventDeleted($this, $this->pre_remove_events ));
|
||||
$this->pre_remove_events = null;
|
||||
}
|
||||
|
@ -600,6 +600,17 @@ class Summit extends SilverstripeBaseModel
|
||||
$this->notifications = new ArrayCollection;
|
||||
$this->selection_plans = new ArrayCollection;
|
||||
$this->meeting_booking_room_allowed_attributes = new ArrayCollection();
|
||||
$this->mark_as_deleted = false;
|
||||
}
|
||||
|
||||
private $mark_as_deleted;
|
||||
|
||||
public function markAsDeleted(){
|
||||
$this->mark_as_deleted = true;
|
||||
}
|
||||
|
||||
public function isDeleting():bool{
|
||||
return $this->mark_as_deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1657,6 +1657,7 @@ final class SummitService extends AbstractService implements ISummitService
|
||||
);
|
||||
}
|
||||
|
||||
$summit->markAsDeleted();
|
||||
$this->summit_repository->delete($summit);
|
||||
|
||||
Event::fire(new SummitDeleted($summit_id));
|
||||
|
@ -387,7 +387,7 @@ final class OAuth2SummitApiTest extends ProtectedApiTest
|
||||
|
||||
$summit = $this->testAddSummit();
|
||||
$params = [
|
||||
'id' => $summit->id
|
||||
'id' => 31
|
||||
];
|
||||
|
||||
$headers = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user