Add a CSS class to the masquarade as user link

Created on 11 July 2024, over 1 year ago

Problem/Motivation

When viewing a user, add a CSS class to the link so it can be styled.

Remaining tasks

None. See attached patch.

The link now has the CSS class 'masquerade-as-user-link'.

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡³šŸ‡±Netherlands Sander Wemagine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Sander Wemagine
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work about 1 year ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Sander Wemagine,

    Thank you for your patch. I tried to apply it and I encountered an error.

    āžœ  masquerade git:(8.x-2.0-rc4) curl https://www.drupal.org/files/issues/2024-07-11/masquerade-css-class.patch | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   795  100   795    0     0   3603      0 --:--:-- --:--:-- --:--:--  3613
    Checking patch modules/contrib/masquerade/src/MasqueradeCallbacks.php...
    error: modules/contrib/masquerade/src/MasqueradeCallbacks.php: No such file or directory
    āžœ  masquerade git:(8.x-2.0-rc4)

    I tried using the apply -v but I still need to specify the path for the file in order to apply the patch.

    āžœ  masquerade git:(8.x-2.0-rc4) curl https://www.drupal.org/files/issues/2024-07-11/masquerade-css-class.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   795  100   795    0     0   3899      0 --:--:-- --:--:-- --:--:--  3916
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    |--- web/modules/contrib/masquerade/src/MasqueradeCallbacks.php	2024-07-11 14:34:28
    |+++ web/modules/contrib/masquerade/src/MasqueradeCallbacks.php	2024-07-11 14:34:51
    --------------------------
    File to patch: web/modules/contrib/masquerade/src/MasqueradeCallbacks.php
    web/modules/contrib/masquerade/src/MasqueradeCallbacks.php: No such file or directory
    Skip this patch? [y] n
    File to patch: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/masquerade/src/MasqueradeCallbacks.php
    patching file /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/masquerade/src/MasqueradeCallbacks.php
    āžœ  masquerade git:(8.x-2.0-rc4) āœ—

    I then proceed with my testing. However, I did not find the class added.

    These are the steps I followed.

    1. Installed the module
    2. Go to People
    3. Scroll down to the users list
    4. Under the Operations column, click on the dropdown menu
    5. Open dev tool
    6. Inspect the link
    7. Applied the patch
    8. Restart
    9. Inspected the link again
    10. Uninstalled then installed the modules (I did not delete the files)
    11. Performed Step 2 - 6 again

    Please let me know if I did any wrong. If so, may I request instructions on how to test the issue?

    Attaching some screenshots for reference.

    Please check and advise. Especially on the issue of applying the patch.

    Thank you.

  • Assigned to anirudhsingh19
  • šŸ‡®šŸ‡³India anirudhsingh19

    working on it.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 185s
    #577205
  • šŸ‡®šŸ‡³India anirudhsingh19

    @cleavinjosh The patch provided earlier was not getting applied cleanly due to the incorrect path in the patch. Also, to test the changes go to the user profile page e.g /user/2, the current changes is for that page not for /admin/people. I have implemented the code, Please review!

Production build 0.71.5 2024