- Issue created by @nghua
- 🇨🇦Canada nghua
I think my merge request is ready for review now, I know there are failing tests but they were failing before my patch.
- 🇨🇦Canada mparker17 UTC-4
I've reviewed the code changes in the merge request, and it looks good to me.
I ran some manual tests (documented below) of the basic functionality on the code in !4 and Drupal 11, and I was able to get it to work.
Here's what I did to test !4...
- Install ddev (I tested on version 1.24.1)
- Clone the module, issue fork, and branch:
git clone --branch '2.x' https://git.drupalcode.org/project/masquerade_field.git && cd masquerade_field/
- clone the projectgit remote add masquerade_field-3495033 git@git.drupal.org:issue/masquerade_field-3495033.git && git fetch masquerade_field-3495033
- add a remote for the issue forkgit checkout -b '3495033--drupal-11' --track masquerade_field-3495033/'3495033--drupal-11'
- switch to the branch for merge request !4
- Set up a test site for the module with the ddev/ddev-drupal-contrib plugin:
ddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=masquerade-field
- create a ddev project for testing the moduleddev add-on get ddev/ddev-drupal-contrib && ddev start && ddev poser && ddev symlink-project
- run the setup steps for the ddev/ddev-drupal-contrib addon- Go to
https://masquerade-field.ddev.site/core/install.php
in a browser. Confirm that I saw the Drupal 11.1.0 installer. Install the site with the "Standard" install profile. - Go to
/admin/people/create
and create a user with the Content editor role. I gave mine the usernametest_editor
. - Go to
/admin/people/create
and create a user with the Authenticated role. I gave mine the usernametest_user
.
- Set up the module for testing:
- Go to
/admin/modules
and install masquerade_field and its dependencies - Go to
/admin/people/permissions
, grant the Content editor role the following permissions:- Masquerade Field -> Edit the masquerade field
- Masquerade Field -> View any masquerade field
- Masquerade Field -> View own masquerade field
- User -> View user information
... click Save permissions
- Go to
-
Test the basic module functions in Drupal 11:
- Log out of the administrator account, and log in as the
test_editor
Content editor user created earlier. - Go to the edit tab for the test_editor account (on my test site, it was at
/user/2/edit
). You see a Masquerade as field. - Enter
test_editor
into the Masquerade as autocomplete, and select it from the autocomplete drop-down (on my test site, that made it saytest_editor (2)
. - Click Save at the bottom of the page.
- You see the error message User test_editor cannot masquerade as itself.
- Enter
test_user
into the Masquerade as autocomplete, and select it from the autocomplete drop-down (on my test site, that made it saytest_user (3)
) - Click Save at the bottom of the page.
- You see the status message The changes have been saved.
- Click the View tab at the top of the page.
- You see a Masquerade as field, with a link to masquerade as test_user.
- Click the test_user link to masquerade as the test_user.
- You see the status message You are now masquerading as test_user.
- Click the Unmasquerade link in the site header. If you can't see it, you may need to click the Menu button in the top-right corner of the page. If you're not using the Olivero theme, the Unmasquerade link may be located elsewhere.
- You see the status message You are no longer masquerading as test_user.
- Log out of the administrator account, and log in as the
- Make sure there are no errors being logged:
- Log out of the
test_editor
user created earlier; and log in as the administrator again - Go to
/admin/reports/dblog
to ensure our setup/testing did not result in any error messages related to this module.
- Log out of the