Page MenuHomePhabricator

ContactPage does not supply expected variable to emailsenttext message
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to the EnWiki ArbCom block appeal form (implemented in EnWikiContactPages.php)
  • Fill out and submit the form (please indicate that it's a test, and test sparingly, if done on the live wiki)
  • Submit the form

What happens?:
The emailsenttext message defined in core states that the username of the recipient will be passed to the message, but when ContactPage displays the emailsenttext message, it does not pass the recipient username. On Wikis which use the parameter in their custom messages, this leads to differences in behavior between Special:EmailUser and Special:Contact. Example from EnWikit:

Your email message has been sent. $1 will also receive a notification about your email unless they have disabled this in their preferences.
You can additionally notify users that you have emailed them by leaving them a talk page message. The {{You've got mail}} template is available for this purpose. Click new section to use it on User talk:$1.

What should have happened instead?:
The variable should reference User:Arbitration Committee who is the specified user and whose email address successfully receives the email.

Your email message has been sent. Arbitration Committee will also receive a notification about your email unless they have disabled this in their preferences.
You can additionally notify users that you have emailed them by leaving them a talk page message. The {{You've got mail}} template is available for this purpose. Click new section to use it on User talk:Arbitration Committee.

It would also be nice if we could customize this message as well, but that's probably out of scope for this task.

Event Timeline

Enwiki modified the core message mw:MediaWiki:Emailsenttext, with a parameter it does not support.

Which messages are they?

emailsenttext, a core message defined in languages/i18n/qqq.json The spec states that the message receives a parameter, $1, which is the username of the recipient

"Confirmation page: when you send an email, [[Special:EmailUser]] says you this (Your email has been sent).\n\nParameters:\n* $1 - (Optional) the recipient's username, for local customizations"`

If ContactPage is going to use core messages which guarantee a parameter, then the extension should fulfill that guarantee.

Wugapodes renamed this task from Username variable in message not populated when ContactPage is submitted to ContactPage does not supply expected variable to emailsenttext message.Nov 30 2022, 10:26 PM
Wugapodes claimed this task.
Wugapodes updated the task description. (Show Details)

Change 862372 had a related patch set uploaded (by Wugapodes; author: Wugapodes):

[mediawiki/extensions/ContactPage@master] Provide recipient username to emailsenttext message

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

Change 862372 merged by jenkins-bot:

[mediawiki/extensions/ContactPage@master] Provide recipient username to emailsenttext message

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