Make WordPress Core

Opened 10 months ago

Closed 9 months ago

#63006 closed defect (bug) (fixed)

Invalid aria-describedby for email if user not current user

Reported by: kkmuffme's profile kkmuffme Owned by: audrasjb's profile audrasjb
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch has-screenshots commit
Focuses: accessibility Cc:

Description

https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-admin/user-edit.php#L548

<?php
<input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profile_user->user_email ); ?>" class="regular-text ltr" />
                                                        <?php if ( $profile_user->ID === $current_user->ID ) : ?>
                                                                <p class="description" id="email-description">

if user not current user, the aria-describedby is invalid and shouldn't be output

Attachments (12)

before-patch.png (28.7 KB) - added by shailu25 9 months ago.
Before Patch
after-patch.png (27.9 KB) - added by shailu25 9 months ago.
After Patch
Capture d’écran 2025-03-13 à 10.31.37.png (694.2 KB) - added by nandow 9 months ago.
Admin screen : aria-describedby present
Capture d’écran 2025-03-13 à 10.30.56.png (533.0 KB) - added by nandow 9 months ago.
Subscriber screen : aria-describedby removed
admin_profile.png (172.9 KB) - added by eddystile 9 months ago.
Admin screen with aria-describedby present.
user_profile.png (139.4 KB) - added by eddystile 9 months ago.
User profile screen with aria-describedby absent
admin-screen-description-displayed.png (308.3 KB) - added by marineevain 9 months ago.
Admin screen: aria-describedby displayed
subscriber-screen-description-off.png (264.5 KB) - added by marineevain 9 months ago.
Subscriber screen: aria-describedby off
SCR-20250313-jtru.png (280.0 KB) - added by qhaensler 9 months ago.
After patch : aria-describedby is present on the current user
SCR-20250313-jvgo.png (278.0 KB) - added by qhaensler 9 months ago.
After patch : aria-describedby is not present on other users' edition
admin screen.png (286.4 KB) - added by virginienacci 9 months ago.
admin profile
user sceen.png (282.5 KB) - added by virginienacci 9 months ago.
user sceen

Change History (26)

#1 @audrasjb
10 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.8
  • Severity changed from trivial to normal

Good catch! We should indeed use the same condition to determine wether the attribute is relevant or not.

#2 @audrasjb
10 months ago

  • Owner set to audrasjb
  • Status changed from new to assigned

This ticket was mentioned in PR #8376 on WordPress/wordpress-develop by @audrasjb.


10 months ago
#3

  • Keywords has-patch added; needs-patch removed

@audrasjb commented on PR #8376:


10 months ago
#4

## When editing the current user
https://github.com/user-attachments/assets/af464256-9bda-4110-b97a-0df54950cd9e

## When editing another user
https://github.com/user-attachments/assets/4d68574e-5658-44a5-ae74-fb22de264994

#5 @audrasjb
10 months ago

  • Focuses accessibility added
  • Keywords has-screenshots added

#6 @faisal03
9 months ago

Test Report

Before

https://app.screencast.com/bIKIj8rp25vRW

After

https://app.screencast.com/uphnvUBmHBdJ9

Environment

  • OS: macOS
  • Localhost Server: Nginx
  • PHP: 8.3.0
  • WordPress: 6.7.2
  • Browser: Chrome
  • Theme: TT4

Actual Results

  • ✅ The patch is working fine and now the aria-describedby is not visible when the user is not a current user.

#7 @shailu25
9 months ago

Test Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8376

Environment:
WordPress - 6.8-beta2
OS - Windows
Browser - Firefox
Theme: Twenty Twenty Five
PHP - 8.2.12
Active Plugin: Beta Tester

Actual Results:

  • Issue Resolved With Patch.✅
  • aria-describedby is not visible when the user is not a current user.

Screenshots:

  • Added Attachment
Last edited 9 months ago by shailu25 (previous) (diff)

@shailu25
9 months ago

Before Patch

@shailu25
9 months ago

After Patch

@nandow
9 months ago

Admin screen : aria-describedby present

@nandow
9 months ago

Subscriber screen : aria-describedby removed

#8 @nandow
9 months ago

Hello,

It's my first contribution during the Whodunit's contribution day.
I tested the patch and it's ok for me.

Best,

@eddystile
9 months ago

Admin screen with aria-describedby present.

@eddystile
9 months ago

User profile screen with aria-describedby absent

#9 @eddystile
9 months ago

Hi,

The test went well. And even tested with the user switching plugin.

@marineevain
9 months ago

Admin screen: aria-describedby displayed

@marineevain
9 months ago

Subscriber screen: aria-describedby off

#10 @marineevain
9 months ago

Hi all,

Same as Nandor, during our Contribution Day at Whodunit, I tested this patch and it looks to work fine for me.
Have a great day!

@qhaensler
9 months ago

After patch : aria-describedby is present on the current user

@qhaensler
9 months ago

After patch : aria-describedby is not present on other users' edition

@virginienacci
9 months ago

admin profile

@virginienacci
9 months ago

user sceen

#11 @virginienacci
9 months ago

Hi all,

Same as Nandor, Marine and Quentin, during our Contribution Day at Whodunit, I tested this patch and it looks to work fine for me.
Have a great day!

#12 @qhaensler
9 months ago

Test Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8376

Environment:
WordPress - 6.8-alpha-20250222.085844
Tested with playground.wordpress.net

Results:
aria-describedby is not added on other user edition and the description doesn't exist.

Screenshots:
Added Attachment

#13 @audrasjb
9 months ago

  • Keywords commit added

Thanks everyone for testing the patch :)
Let's ship this, then.

#14 @audrasjb
9 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 59978:

Users: Remove unwanted aria-describedby attribute in User Edit.

This changeset removes the aria-describedby attribute when not editing the current user, as no description paragraph is associated.

Props kkmuffme, audrasjb, faisal03, shailu25, nandow, eddystile, marineevain, qhaensler, virginienacci.
Fixes #63006.

Note: See TracTickets for help on using tickets.