Add db-prefix from env conf when command admin:user:create is executed#11199
Add db-prefix from env conf when command admin:user:create is executed#11199okorshenko merged 1 commit intomagento:2.2-developfrom
Conversation
|
Is it an easiest way to make |
|
Where would you put PS: maybe i didn't understand your question |
|
I'm referring to the underlying |
|
Ahh Ok, Maybe would be better approach, but in this case, Only found a reference for |
|
What about any other interactions with database? |
|
Yeah, I know, but in Internal Ticket: I can change again but I don't know certainly is good idea. |
There was a problem hiding this comment.
Fix must be moved into model \Magento\Setup\Model\Installer::installAdminUser. This class is already aware of deploymentConfig, all occurrences of DB_PREFIX are already in models.
There was a problem hiding this comment.
Added Magento\Setup\Module\Setup to Interface AdminAccountFactory inside installAdminUser.
I hope these changes are ok for you.
There was a problem hiding this comment.
I don't think we should change AdapterInterface back to Setup.
I suggested just to move DB prefix obtaining from command to \Magento\Setup\Model\Installer::installAdminUser model (not to any other model).
|
Added to Installer the information about |
0ff8edb to
41410ac
Compare
|
Squashed commits in one, Thanks @orlangur |
|
Great! 👍 |
Read config env.php to get db-prefix when command
admin:user:createis executedDescription
If you don't read
db-prefixin env.php you don't have this information in this function:Magento\Setup\Model\AdminAccount::getTableNamethat is called in first instance in\Magento\Setup\Model\Installer::installAdminUser.Fixed Issues (if relevant)
Manual testing scenarios
php bin/magento admin:user:create --admin-user=user --admin-password=pass123Lolailo --admin-email=mail@mail.com --admin-firstname=fname --admin-lastname=lnameContribution checklist