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
df9c8fd365
https://github.com/octobercms/october/pull/3984
This commit is contained in:
parent
164e9877f7
commit
13d710b161
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue