I just enlarge the UserModel with some new fields and face the problem, that the default values do not apply on balloon-selector fields.
I tested the following configuration in the October Test plugin (a modification of the status from the Location model):
status:
label: Status
type: balloon-selector
span: auto
options:
0: Active
1: Draft
2: Hidden
trigger:
action: enable
field: is_enabled
condition: checked
default: 0
The default value is perfectly applied
Now this is how I modify my model:
UserController::extendFormFields(function ($form, $model, $context) {
if (!$model instanceof UserModel) return;
$configFile = plugins_path('mch/general/models/user/fields.yaml');
$config = Yaml::parse(File::get($configFile));
$form->addTabFields($config['fields']);
});
and this is my fields.yaml:
fields:
status:
label: Status
type: balloon-selector
span: auto
options:
0: Active
1: Draft
2: Hidden
trigger:
action: enable
field: is_enabled
condition: checked
default: 2
But the value is not applied here.
For me this looks like a bug, but maybe I overlooked something, so thx for any help