This PR is an addition to https://github.com/octobercms/october/pull/4193
Re-using the pivotWidget's and manageWidget's models for saving form data fixes https://github.com/rainlab/translate-plugin/issues/209, where translations are not saved for the model when editing it in a relation widget.
I did some manual testing with this change and everything was working as expected: Translations are now properly saved when creating or editing related models with pivot data. Creating related models in `single` mode now works as well.
Credits to @alxy for his previous work on this issue!
This change allows for easy customisation of the relation manager titles and toolbar buttons.
For buttons - define your custom strings directly in the standard `toolbarButtons` syntax...
```
toolbarButtons:
create: acme.blog::lang.subcategory.CreateButtonText
delete: # omit the string to fall back to the default button text
```
...and the old syntax still works...
```
toolbarButtons: create|delete
```
For titles - define different strings for each mode (form, list or pivot)...
```
title:
form: acme.blog::lang.subcategory.FormTitle
list: acme.blog::lang.subcategory.ListTitle
```
This feature provides developer convenience, for example in this situation where I have a relation manager that is used to assign user permissions to a project:
Before

After

This PR contains no breaking changes.
This is a complex issues where a "model not found" exception is getting thrown during the `pageAction` cycle, then getting suppressed by the fatal error handler:
try {
// RelationController throws error here
}
catch (Exception $ex) {
$this->controller->handleError($ex);
}
Fixes#4784
Credit to @alxy.
If the default format mode is selected, there is no chance to configure the format options for delimiter, enclosure, escape and encoding. This considers a new config file item `defaultFormatOptions` and falls back to `null` if it is not specified.
To keep things consistent, the old default values remain untouched.
Credit to @tobias-kuendig. Added $.oc.relationBehavior.changed function. To keep track of changes made using the relation controller this new "changed" function is called every time a record is created, added, removed or deleted. The function triggers the change.oc.formwidget event on the form field that belongs to this relation controller so other form fields are notified about the changes.