mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fix support for updating belongsTo relationships with the RelationController.
Fixes #5198, #5243; replaces #5217. Related: 6e25c5a8d0
#
This commit is contained in:
parent
f708754f07
commit
5a843bc909
@ -1157,7 +1157,11 @@ class RelationController extends ControllerBehavior
|
||||
}
|
||||
}
|
||||
elseif ($this->viewMode == 'single') {
|
||||
$this->viewModel = $this->manageWidget->model;
|
||||
// Ensure that the view widget model is the same instance as the manage widget model
|
||||
// since they will technically be different object instances in this context as
|
||||
// $viewWidet->model is populated by $this->relationModel->getResults() and
|
||||
// $manageWidget->model is populated by $this->relationModel->find($manageId);
|
||||
$this->viewModel = $this->viewWidget->model = $this->manageWidget->model;
|
||||
|
||||
$this->viewWidget->setFormValues($saveData);
|
||||
$this->viewModel->save(null, $this->manageWidget->getSessionKey());
|
||||
|
Loading…
x
Reference in New Issue
Block a user