Add a CSS class to the masquarade as user link

Created on 11 July 2024, 5 months ago
Updated 7 August 2024, 5 months 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

Needs work

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

Comments & Activities

  • Issue created by @Sander Wemagine
  • Status changed to Needs review 5 months ago
  • Status changed to Needs work 5 months 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.

Production build 0.71.5 2024