Halcyon models don't support relations

Use a simple fill() approach instead of trying to set nested fields via their relations
Refs https://github.com/rainlab/translate-plugin/issues/216
This commit is contained in:
Samuel Georges 2017-02-03 06:00:52 +11:00
parent dc85993584
commit 3365aee129
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,8 @@
use Str;
use Backend\Classes\FormField;
use October\Rain\Halcyon\Model as HalcyonModel;
use October\Rain\Database\Model as DatabaseModel;
/**
* Form Model Saver Trait
@ -50,6 +52,11 @@ trait FormModelSaver
return;
}
if ($model instanceof HalcyonModel) {
$model->fill($saveData);
return;
}
$attributesToPurge = [];
$singularTypes = ['belongsTo', 'hasOne', 'morphOne'];