-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update documetation for developer to create user with service #479
Comments
You should not be creating an user like that. You should be using UserCreateService to create a new user. Via what you do - its not a bug. Have a look at here for an example to create an user and assign a role |
This documentation should probably be updated then. |
Yup, the documentation is weird for that section, and has mistakes in it. I don't think we should be referring to a migration approach specifically for creating an user programmatically. Should be an example without the migration context and have something like https://github.com/2amigos/yii2-usuario/blob/master/src/User/Command/CreateController.php#L48 I ran the above example on my dev, bud did not get errors on migrate/up, but /down (has mistakes). Anyway the documentation for sure needs a change here. |
Hi Tonis, I still have an issue even when running
|
How does your user module config look like? |
@TonisOrmisson ah that is it. I had not put this in <?php
return [
'modules' => [
'user' => [
'class' => Da\User\Module::class,
'administrators' => ['admin'],
],
]
]; |
What steps will reproduce the problem?
When following the guide for creating a user on a fresh install the process errors. This is based off the yii2-advanced-app
yii2-advanced-app
2amigos/yii2-usuario
& follow guideWhat is the expected result?
User should be created without an error.
What do you get instead?
First there is an error about
$this->module->enableGdprCompliance
fails. Then I18N fails if the line inUser
is commented out.The text was updated successfully, but these errors were encountered: