Skip to content
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

[Issue] Remove "Administrators" name from the query to fetch an administrators role #36998

Closed
6 tasks done
m2-assistant bot opened this issue Mar 7, 2023 · 4 comments
Closed
6 tasks done
Labels
Area: Framework Component: Login Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@m2-assistant
Copy link

m2-assistant bot commented Mar 7, 2023

This issue is automatically created based on existing pull request: #36971: Remove "Administrators" name from the query to fetch an administrators role


Description (*)

When we set up a review environment with the production database and we try to create an admin account, we get the "No Administrators role was found, data fixture needs to be run" error.

This is because the query searches for a role actually named "Administrators", but our client renamed the "Administrators" role to "All rights". Looking for a role with exactly that name isn't needed since it'll just use the first one it finds with the correct rights. This change makes sure it'll just use the first matching role it finds, regardless of name.

mysql> select * from authorization_role WHERE parent_id = 0 AND tree_level = 1 AND role_type = 'G' AND user_id = 0 AND user_type = 2 ORDER BY sort_order DESC LIMIT 1;
+---------+-----------+------------+------------+-----------+---------+-----------+--------------+
| role_id | parent_id | tree_level | sort_order | role_type | user_id | user_type | role_name    |
+---------+-----------+------------+------------+-----------+---------+-----------+--------------+
|       1 |         0 |          1 |          1 | G         |       0 | 2         | All rights   |
+---------+-----------+------------+------------+-----------+---------+-----------+--------------+

Related Pull Requests

Fixed Issues (if relevant)

No issue created.

Manual testing scenarios (*)

  1. Rename the "Adminstrators" role to something else
  2. Run bin/magento admin:user:create --admin-user=johndoe --admin-firstname=John --admin-lastname=Doe --admin-password=JohnDoe123 --admin-email="johndoe@example.com"

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Remove "Administrators" name from the query to fetch an administrators role #36997: Remove "Administrators" name from the query to fetch an administrators role
@m2-assistant
Copy link
Author

m2-assistant bot commented Mar 8, 2023

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Lima engcom-Lima added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Login Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.x Indicates original Magento version for the Issue report. Area: Framework labels Mar 8, 2023
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-8146 is successfully created for this GitHub issue.

@m2-assistant
Copy link
Author

m2-assistant bot commented Mar 8, 2023

✅ Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-November engcom-November removed their assignment Mar 9, 2023
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Jul 17, 2023
@ihor-sviziev
Copy link
Contributor

The fix for this issue was delivered to 2.4-develop branch in 5344e89 (changes from #36971)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Login Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

Successfully merging a pull request may close this issue.

5 participants