i have the same problem but with php file.
kirby::plugin('user_name/package_name', [
'blueprints' => [
'users/member' => function () {
return include __DIR__ . '/blueprints/users/member.php';
},
],
// I tried this too
'hooks' => [
'user.create:after' => function (User $user) {
$user->changeRole('member');
}
]
]);
member.php:
return [
'title' => 'Mitglied',
'name' =>' member',
'description' => 'Hier fehlt noch die Beschreibung',
'permissions' => [
'access' => [
'panel' => false
]
],
'columns' => [
'top'=> [
'width' => '1/1',
'fields' => [
'firstname' => [
'type' => 'text',
'label' => 'Vorname',
'required' => true
],
'lastname' => [
'type' => 'text',
'label' => 'Nachname',
'required' => true
]
]
],
'left' => [
'width' => '1/2',
'fields' => [
'street' => [
'label' => 'Straße und Hausnummer',
'type' => 'text'
],
'zip' => [
'label' => 'Postleitzahl',
'type' => 'text',
'width' => '1/4'
],
'city' => [
'label' => 'Stadt/Ort',
'type' => 'text',
'width' => '3/4'
],
'country' => [
'label' => 'Land',
'type' => 'text'
]
]
],
'middle' => [
'width' => '1/2',
'fields' => [
'email' => [
'label' => 'E-Mail',
'type' => 'email'
],
'phone' => [
'label' => 'Telefon',
'type' => 'tel',
'icon' => 'phone',
'placeholder' => '+49'
],
'mobilePhone' => [
'label' => 'Telefon (mobil)',
'type' => 'tel',
'icon' => 'phone',
'placeholder' => '+49'
],
'birthday' => [
'label' => 'Geburtsdatum',
'type' => 'date',
'display' => 'DD.MM.YYYY'
]
]
],
'right' => [
'width' => '1/3',
'fields' => [
'rolle' => [
'label' => 'Rolle',
'type' => 'select',
'options' => UserMemberPage::rollen()
],
'funktion' => [
'label' => 'Funktion/Position',
'type' => 'select',
'options' => UserMemberPage::positionen()
]
]
]
]
];
The user is created but with the role “nobody”. If I then manually change the role to “member” then my PHP based blueprint also works.