Skip to content

Fixed admin:user:create failing when admin role has different name#592

Merged
fballiano merged 2 commits intomainfrom
fix/admin-user-create-role-lookup
Feb 25, 2026
Merged

Fixed admin:user:create failing when admin role has different name#592
fballiano merged 2 commits intomainfrom
fix/admin-user-create-role-lookup

Conversation

@fballiano
Copy link
Contributor

Summary

  • Replace hardcoded "Administrators" role name lookup with a structural query (tree_level=1, ordered by role_id ASC) so the command works regardless of the role display name
  • Fixes databases migrated from Magento 1 / OpenMage where the role is named "Administrator" (singular)

Fixes #586

Test plan

  • Run ./maho admin:user:create on a fresh install (role named "Administrators")
  • Run ./maho admin:user:create on a migrated database (role named "Administrator")

Look up the root admin role by structure (tree_level=1) instead of
hardcoding the "Administrators" name, which doesn't match databases
migrated from Magento 1 / OpenMage where it's "Administrator".

Fixes #586
@fballiano fballiano added this to the 26.3.0 milestone Feb 25, 2026
@fballiano fballiano changed the title Fix admin:user:create failing when admin role has different name Fixed admin:user:create failing when admin role has different name Feb 25, 2026
@fballiano fballiano merged commit c956855 into main Feb 25, 2026
24 checks passed
@fballiano fballiano deleted the fix/admin-user-create-role-lookup branch February 25, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admin:user:create fails when Administrators role has different name

1 participant