- Issue created by @nghua
- Merge request !4Issue #3495033: Drupal 11 compatibility fixes β (Merged) created by Unnamed author
- π¨π¦Canada nghuaI 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-4I'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 project
- git 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 fork
- git 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 module
- ddev 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.phpin a browser. Confirm that I saw the Drupal 11.1.0 installer. Install the site with the "Standard" install profile.
- Go to /admin/people/createand create a user with the Content editor role. I gave mine the usernametest_editor.
- Go to /admin/people/createand create a user with the Authenticated role. I gave mine the usernametest_user.
 
- Set up the module for testing:
- Go to /admin/modulesand 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_editorContent 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_editorinto 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_userinto 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_editoruser created earlier; and log in as the administrator again
- Go to /admin/reports/dblogto ensure our setup/testing did not result in any error messages related to this module.
 
- Log out of the 
 
- Issue was unassigned.
- Status changed to RTBC6 months ago 6:02pm 14 May 2025
- πΊπΈUnited States ajetiv1Is there a patch for Drupal 11, or will there be a new version release at some point 
- π¨π¦Canada mparker17 UTC-4@ajetiv1, for now, the changes are in merge request !4, attached to this issue. If you'd like a patch (e.g.: for Composer), there are instructions to download a patch in the Using GitLab to contribute to Drupal documentation on Downloading a patch file β . 
- π¬π·Greece dimiliasidimopoulos β made their first commit to this issueβs fork. 
- π¬π·Greece dimiliasI have further fixed the failing test, added the new hooks mechanism of D11.1+ and fixed codesniffs and phpstan. 
 Requesting one more review.
- π¨π¦Canada andrew.wangI've tested one more time using steps in #6: γβ Install ddev (I tested on version 1.24.6) 
 γβ Clone the module, issue fork, and branch:
 γβ 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 module
 γγβ ddev 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. (I tested on 11.2.2). 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 username test_editor.
 γγβ Go to /admin/people/create and create a user with the Authenticated role. I gave mine the username test_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 
 γβ 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 say test_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 say test_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.
 γβ 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.Moving to RTBC again! 
- 
            
              idimopoulos β
             committed 3f6aee46 on 2.x authored by 
            
              ahhua β
            
Issue #3495033 by idimopoulos, ahhua, mparker17, andrew.wang: Drupal 11... 
 
- 
            
              idimopoulos β
             committed 3f6aee46 on 2.x authored by 
            
              ahhua β
            
- Automatically closed - issue fixed for 2 weeks with no activity.