From 13d710b161bdf65a19f38f974c259bc4997a162c Mon Sep 17 00:00:00 2001 From: Alexander Guth Date: Sat, 16 Mar 2019 05:32:36 +0100 Subject: [PATCH] Reuse the model instance from Form widget (#4193) Credit to @alxy & @jimcottrell . Refs: https://github.com/rainlab/translate-plugin/issues/209 https://github.com/rainlab/translate-plugin/issues/242 https://github.com/rainlab/translate-plugin/issues/330 https://github.com/rainlab/translate-plugin/issues/380 https://github.com/jan-vince/smallextensions/issues/11 https://github.com/OFFLINE-GmbH/oc-mall-plugin/issues/128 https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/issues/21 https://github.com/OFFLINE-GmbH/oc-gdpr-plugin/pull/55 https://github.com/OFFLINE-GmbH/oc-snipcartshop-plugin/commit/df9c8fd365acc1037d2d0b11d3da15a8acda43c4 https://github.com/octobercms/october/pull/3984 --- modules/backend/behaviors/RelationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index bd1664a83..6eefd1444 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -1062,7 +1062,7 @@ class RelationController extends ControllerBehavior $saveData = $this->manageWidget->getSaveData(); if ($this->viewMode == 'multi') { - $model = $this->relationModel->find($this->manageId); + $model = $this->manageWidget->model; $modelsToSave = $this->prepareModelsToSave($model, $saveData); foreach ($modelsToSave as $modelToSave) { $modelToSave->save(null, $this->manageWidget->getSessionKey());