Hi I have a plugin with models using $belongsTo relations. The relations managers display fine. Records are created and saved via the create or update relation buttons with no problem. However, when I try to update a record via the relation update button/form, it appears as if it is updating and saving, however, when I reopen the record, no changes were applied. I've logged the data passed to the model and the changes are not being passed to the models. So, the relation creates the record but will not update the same record.
In the models I have fields user_id, client_id, application_id with the relations defined as
public $belongsTo = [ 'user' => ['RainLab\User\Models\User'], 'client' => ['DigiMed\RecordManager\Models\Client'], 'application' => ['DigiMed\RecordManager\Models\Application'], ];
In the controller I have:
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController', 'Backend\Behaviors\RelationController'
public $listConfig = 'config_list.yaml'; public $formConfig = 'config_form.yaml'; public $relationConfig = 'config_relation.yaml';
In config_relation.yaml I have eg
application: label: 'Application' deferredBinding: true //I tried without deferredBinding as well view: form: $/digimed/recordmanager/models/application/fields.yaml toolbarButtons: update|delete manage: form: $/digimed/recordmanager/models/application/fields.yaml list: $/digimed/recordmanager/models/application/columns.yaml
I'd have to see more of your Mode/Controller classes to be able to help
Also, your config_relation.yaml should have:
view: list: ... path to columns.yaml
view: form: ...
disregard my last comment, this is fine with belongsTo relationships.
1-7 of 7