Page MenuHomePhabricator

FULLPAGENAMEE produces Special:Badtitle/Message in pending changes message
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:
The link goes to https://en.wikipedia.org/w/index.php?title=Special:Badtitle/Message&stable=1
A similar error happens for the two other links in the message.

What should have happened instead?:
The link should go to a page like https://en.wikipedia.org/w/index.php?title=Example&stable=1 if the article was "Example".

The message is made by https://en.wikipedia.org/wiki/MediaWiki:Revreview-pending-basic where {{FULLPAGENAMEE}} incorrectly produces "Special:Badtitle/Message" instead of the page name.
The same page history displays a message made by https://en.wikipedia.org/wiki/MediaWiki:Histlegend where {{FULLPAGENAMEE}} correctly gives the page name.

It was reported at https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1258774761#Special:Badtitle_in_pending_changes_notice
The cause may be https://gerrit.wikimedia.org/r/q/016644c4 ("Do not pre-parse MessageValue arguments") which was deployed at enwiki today. It was made for T380045.

Acceptance criteria

  • "latest accepted version" link in #mw-fr-revision-tag-edit is fixed
  • "# pending changes" link in #mw-fr-revision-details is fixed
  • others? CodeSearch

Event Timeline

matmarex subscribed.

"Badtitle/Message" only comes from one place: https://codesearch.wmcloud.org/search/?q=Badtitle%2FMessage

Caused by 9dd50f2cd07e / https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1082715

This could also be fixed in FlaggedRevs by passing the current context to the message, instead of relying on the global context. There are apparently two very similar functions, one of which lets you do it correctly, and another one that doesn't: https://codesearch.wmcloud.org/search/?q=pendingEditNotice&repos=Extension%3AFlaggedRevs

I want to point out that this problem has significant impact on Wikipedia versions with many pending changes like de.Wikipedia (>18,000) and pl.Wikipedia (>11,000). It is still possible to review pages by using the history, but not all users know that.

All in all, I think this is a high priority bug.

Here is JavaScript to fix it right away at a given wiki:

var q = document.getElementById("mw-fr-revision-tag-edit");
if (q) q.innerHTML = q.innerHTML.replace(/Special:Badtitle\/Message/g, mw.config.get('wgPageName'));

Change "Special" to the local name in non-English wikis.
Place the code in Special:MyPage/common.js to fix it for yourself, or get an interface administrator to place it in MediaWiki:Common.js for everybody.

The third link to the diff but not the first two links can be fixed without JavaScript with an edit similar to https://en.wikipedia.org/w/index.php?title=MediaWiki%3ARevreview-pending-basic&diff=1258829219&oldid=1258771965
It only requires a normal administrator.

Change #1094402 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/extensions/FlaggedRevs@master] Pass context to messages

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

Change #1094402 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Pass context to 'revreview-pending-basic' on history page

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

This patch fixes the message shown on the page history view (exactly following the original replication steps), but as I was reviewing it, I realized that the same issue is present in at least one more place: the "Checked" / "Pending" tooltip on the page reading view. (This is the only one I found, but I haven't tested the whole extension carefully.)

image.png (2×3 px, 452 KB)

That will require another patch.

On the bright side, I noticed that other links with the same purpose already function correctly: those in the text on the page editing view (which is identical to the one in the history), and the "(View all pending changes)" link on the diff view. So at least you can use those until we fix the other issues.

I listed every message in FlaggedRevs that uses {{FULLPAGENAMEE}} (or similar magic words, but there aren't any such messages), then looked at the code that uses them. It looks like all of the uses in FlaggedRevsHTML.php need to be updated, and everything else is already fine.

Not a bad idea, but the messages using {{FULLPAGENAMEE}} would actually have worked correctly if they used the global context from RequestContext::getMain()->msg( … ), they only don't work because they used wfMessage( … ) (which would previously fall back to the global context, but now it doesn't).

Change #1095312 had a related patch set uploaded (by Wargo; author: Wargo):

[mediawiki/extensions/FlaggedRevs@master] Use Contexts for Message objects.

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

Thanks for fixing the remaining problems @Wargo. I'll schedule these patches for deployment about an hour from now (https://wikitech.wikimedia.org/wiki/Deployments#deploycal-item-20241125T1400).

Change #1095312 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Use Contexts for Message objects in review dialog (tooltip)

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

Change #1097381 had a related patch set uploaded (by Bartosz Dziewoński; author: Isabelle Hurbain-Palatin):

[mediawiki/extensions/FlaggedRevs@wmf/1.44.0-wmf.4] Pass context to 'revreview-pending-basic' on history page

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

Change #1097382 had a related patch set uploaded (by Bartosz Dziewoński; author: Wargo):

[mediawiki/extensions/FlaggedRevs@wmf/1.44.0-wmf.4] Use Contexts for Message objects in review dialog (tooltip)

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

Change #1097381 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@wmf/1.44.0-wmf.4] Pass context to 'revreview-pending-basic' on history page

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

Change #1097382 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@wmf/1.44.0-wmf.4] Use Contexts for Message objects in review dialog (tooltip)

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

Mentioned in SAL (#wikimedia-operations) [2024-11-25T14:41:45Z] <lucaswerkmeister-wmde@deploy2002> Started scap sync-world: Backport for [[gerrit:1097381|Pass context to 'revreview-pending-basic' on history page (T380519)]], [[gerrit:1097382|Use Contexts for Message objects in review dialog (tooltip) (T380519)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-25T14:48:17Z] <lucaswerkmeister-wmde@deploy2002> lucaswerkmeister-wmde, matmarex: Backport for [[gerrit:1097381|Pass context to 'revreview-pending-basic' on history page (T380519)]], [[gerrit:1097382|Use Contexts for Message objects in review dialog (tooltip) (T380519)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-25T14:57:19Z] <lucaswerkmeister-wmde@deploy2002> Finished scap sync-world: Backport for [[gerrit:1097381|Pass context to 'revreview-pending-basic' on history page (T380519)]], [[gerrit:1097382|Use Contexts for Message objects in review dialog (tooltip) (T380519)]] (duration: 15m 35s)

matmarex removed a project: Patch-For-Review.

This should be fixed on all wikis now.