-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add db-prefix from env conf when command admin:user:create is executed #11199
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
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. |
$installer->installAdminUser($input->getOptions()); | ||
$options = $input->getOptions(); | ||
$options['db-prefix'] = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_DB_PREFIX); | ||
$installer->installAdminUser($options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:create
is executedDescription
If you don't read
db-prefix
in env.php you don't have this information in this function:Magento\Setup\Model\AdminAccount::getTableName
that 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 [email protected] --admin-firstname=fname --admin-lastname=lname
Contribution checklist