When i upload file by relation manager, i expect that file will be uploaded to related model
File is added to deferred_bindings table but not to model
main model has $hasOne binding to another model. Atother model has $attachOne relation to file.
382
Suggested fix (modules/backend/behaviors/RelationController.php):
public function onRelationManageUpdate()
{
$this->forceManageMode = 'form';
$this->beforeAjax();
$saveData = $this->manageWidget->getSaveData();
if ($this->viewMode == 'multi') {
$model = $this->relationModel->find($this->manageId);
$modelsToSave = $this->prepareModelsToSave($model, $saveData);
foreach ($modelsToSave as $modelToSave) {
$modelToSave->save(null, $this->manageWidget->getSessionKey());
}
}
elseif ($this->viewMode == 'single') {
$this->viewWidget->setFormValues($saveData);
$this->viewModel->save(null, $this->manageWidget->getSessionKey());
}
return ['#'.$this->relationGetId('view') => $this->relationRenderView()];
}
@lukaszbanas-extremecoding Are you able to submit a PR to the test plugin for replication so that we can test your issue and your fix?
Fixed by #2610, thanks @lukaszbanas-extremecoding!
Most helpful comment
Fixed by #2610, thanks @lukaszbanas-extremecoding!