Page MenuHomePhabricator

Accepting pending changes while editing an article using Visual Editor doesn't work anymore
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • On a wiki with flagged revisions enabled, open an article with some unreviewed changes
  • Make sure your account has reviewer rights
  • Edit the article using Visual Editor or Wikitext 2017 editor.
  • Before saving, check „accept this version (including x pending changes)“

Screenshot 2024-05-19 at 21.44.10.png (1×1 px, 577 KB)

What happens?:

What should have happened instead?:

  • The edit should get reviewed, just as it does if you edit an article using the normal source editor and check „accept this version...“
  • See e.g. my latest edit to another article using the normal source editor, which got reviewed as expected when I clicked „accept this version“ while saving my edit https://de.wikipedia.org/w/index.php?title=Alleyway&action=history

There are multiple people reporting the same problem at dewiki https://de.wikipedia.org/w/index.php?title=Wikipedia:Technische_Wünsche/Reparaturhilfe&diff=prev&oldid=245115797 / https://de.wikipedia.org/w/index.php?title=Wikipedia:Technik/Werkstatt&diff=prev&oldid=245016890

Event Timeline

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

[mediawiki/extensions/FlaggedRevs@master] Revert "Replace global variable $wgRequest"

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

matmarex added subscribers: Fomafix, Ladsgroup, matmarex.

Caused by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/FlaggedRevs/+/1017501 (rEFLReaabc6306b58: Replace global variable $wgRequest)

During API edits, $wgRequest is not the same as RequestContext::getMain()->getRequest(), because ApiEditPage fakes the value of $wgRequest for compatibility with old code like FlaggedRevs, but it does not fake the RequestContext: https://gerrit.wikimedia.org/g/mediawiki/core/+/d195bca224adb1b422ec92be8f576a6df6338cc9/includes/api/ApiEditPage.php#535

FlaggedRevs should be refactored so that it doesn't rely on neither $wgRequest nor RequestContext::getMain()->getRequest(), but until that happens, it has to keep using $wgRequest.

(By the way, the VE "Accept this version…" checkbox is also broken for null edits, even after the revert – I haven't dug into why that happens, and I'm not going to, but bear this in mind when testing.)

Change #1034167 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Revert "Replace global variable $wgRequest"

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

This has been broken for several weeks before anyone noticed, so I don't think it's a terribly urgent fix. Therefore I will let the change roll out with the deployment train later this week, rather than backporting.