From d104d479118c2f9f85993a3add1690a08fa8c670 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Mon, 24 Aug 2020 15:18:33 +0800 Subject: [PATCH] Clear relation fields when unlinking a relation --- modules/backend/behaviors/RelationController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 8def35f28..acbf912b1 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -1331,7 +1331,11 @@ class RelationController extends ControllerBehavior } } + // Reinitialise the form with a blank model + $this->initRelation($this->model); + $this->viewWidget->setFormValues([]); + $this->viewModel = $this->relationModel; } return $this->relationRefresh();