Page MenuHomePhabricator

Special:UserRights shows "send email" for user without valid email
Open, Needs TriagePublic

Description

How to reproduce

  1. Find user without valid email / with disabled email
  2. go to [[Special:UserRights/username]]
  3. there is a link "send email"
  4. after clicking on the link, there is no form for sending email, but to elect a username
  5. after electing and confirming username, the form shows "This user has not specified a valid email address."

Expected behaviour
If the user hasn't valid email / have disabled email, on [[Special:UserRights/username]] is no link to send email.

Event Timeline

Change 593666 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Don't show email link if the user cannot be emailed.

https://gerrit.wikimedia.org/r/593666

Change 593666 merged by jenkins-bot:
[mediawiki/core@master] Don't show email link if the user cannot be emailed.

https://gerrit.wikimedia.org/r/593666

matmarex assigned this task to Ammarpad.
matmarex subscribed.

Change 602196 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Revert "Don't show email link if the user cannot be emailed."

https://gerrit.wikimedia.org/r/602196

DannyS712 subscribed.

Just +2'ed the revert - UserrightsPage::showEditUserGroupsForm accepts either a User or a UserRightsProxy object, and UserRightsProxy lacks the canReceiveEmail method the patch tried to call

Change 602198 had a related patch set uploaded (by Reedy; owner: DannyS712):
[mediawiki/core@wmf/1.35.0-wmf.35] Revert "Don't show email link if the user cannot be emailed."

https://gerrit.wikimedia.org/r/602198

Change 602196 merged by jenkins-bot:
[mediawiki/core@master] Revert "Don't show email link if the user cannot be emailed."

https://gerrit.wikimedia.org/r/602196

Change 602198 merged by jenkins-bot:
[mediawiki/core@wmf/1.35.0-wmf.35] Revert "Don't show email link if the user cannot be emailed."

https://gerrit.wikimedia.org/r/602198

Mentioned in SAL (#wikimedia-operations) [2020-06-04T00:36:01Z] <reedy@deploy1001> Synchronized php-1.35.0-wmf.35/includes/specials/SpecialUserrights.php: T254417 T251534 (duration: 01m 06s)

Change 608213 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Don't show email link if the user cannot be emailed. (2)

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608213

Change 608213 merged by jenkins-bot:
[mediawiki/core@master] Don't show email link if the user cannot be emailed. (2)

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608213

Change 608213 merged by jenkins-bot:
[mediawiki/core@master] Don't show email link if the user cannot be emailed. (2)

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608213

The new check is to only add the link if $isUserInstance && $user->canReceiveEmail() - this means that Special:GlobalUserRights will never include the link, and Special:UserRights will only include it if the user can receive email. Instead, if we on Special:GlobalUserRights we can't determine if the user can receive email, we should still show the link. Sorry to do this again, but reverting the latest patch. @Ammarpad fyi. Sorry I didn't catch this in review

Change 608228 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Revert "Don't show email link if the user cannot be emailed. (2)"

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608228

Change 608228 merged by jenkins-bot:
[mediawiki/core@master] Revert "Don't show email link if the user cannot be emailed. (2)"

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608228

The new check is to only add the link if $isUserInstance && $user->canReceiveEmail() - this means that Special:GlobalUserRights will never include the link, and Special:UserRights will only include it if the user can receive email. Instead, if we on Special:GlobalUserRights we can't determine if the user can receive email, we should still show the link. Sorry to do this again, but reverting the latest patch. @Ammarpad fyi. Sorry I didn't catch this in review

No problem

Ammarpad subscribed.