Clear relation fields when unlinking a relation

This commit is contained in:
Ben Thomson 2020-08-24 15:18:33 +08:00
parent b51428f585
commit d104d47911
No known key found for this signature in database
GPG Key ID: 8BDB18DD0909BE22
1 changed files with 4 additions and 0 deletions

View File

@ -1331,7 +1331,11 @@ class RelationController extends ControllerBehavior
} }
} }
// Reinitialise the form with a blank model
$this->initRelation($this->model);
$this->viewWidget->setFormValues([]); $this->viewWidget->setFormValues([]);
$this->viewModel = $this->relationModel;
} }
return $this->relationRefresh(); return $this->relationRefresh();