Problem/Motivation
In #540008: Add a container parameter that can remove the special behavior of UID#1 an approach was taken where we can simply flag tests that are failing if we turn off user 1's super user powers, so that they can be taken care of in a followup. This issue is to collect all of these followups.
The goal is to have no tests in Drupal core that rely on UID1's special privileges so that we:
- Know these tests are correctly assigning the necessary permissions to run
- Can turn off the super user access policy in D11, knowing it won't break core
- Can remove the super user access policy in D12, providing an admin account recovery tool to replace it
Steps to reproduce
Go into any of the tests flagged with:
/**
* {@inheritdoc}
*
* @todo Remove and fix test to not rely on super user.
* @see https://www.drupal.org/project/drupal/issues/3437620
*/
And:
- Remove the code below that sets the usesSuperUserAccessPolicy to TRUE.
- Run the test to see which test methods are failing
Proposed resolution
Assign the right permissions to make the test go green without the super user access policy. Those few tests that specifically test said policy can obviously stay, but will be removed along with the policy in D12.
Remaining tasks
- core/modules/shortcut/tests/src/
- Functional/ShortcutCacheTagsTest.php
- Functional/ShortcutLinksTest.php
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3439905-nr-bot.txt | 2.25 KB | needs-review-queue-bot |
Issue fork drupal-3439905
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3439905-fix-shortcut-tests
changes, plain diff MR !7455
Comments
Comment #5
solimanharkas commentedComment #6
smustgrave commentedLeft comments on MR.
Comment #7
solimanharkas commentedComment #8
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #9
smustgrave commentedFeedback is addressed, fixed my mistake
Comment #10
alexpottAdded a comment to the MR about the use of the authenticated role.
Comment #12
solimanharkas commented@pradhumanjain2311 With all my respect, I must point out that simply copying the suggested code and adding it, without local testing or noticing its duplication, isn't an appropriate approach to contributing to Drupal.
Comment #13
solimanharkas commentedComment #14
solimanharkas commentedComment #15
smustgrave commentedVery nicely done!
Comment #18
catchCommitted/pushed to 11.x and cherry-picked to 10.3.x, thanks!