Restore global context fiddling to fix FlaggedRevs edit notices and checkboxes

Partially reverts aed5bcf7d0.

Bug: T307852
Change-Id: I6aee2266c6b4dce560196c87b518ac25a493623a
This commit is contained in:
Bartosz Dziewoński 2022-05-11 00:01:50 +02:00
parent 53b169ab43
commit 4ebf2ae8bf

View file

@ -41,6 +41,7 @@ use Parser;
use ParserOptions;
use RawMessage;
use ReadOnlyMode;
use RequestContext;
use Skin;
use SpecialMyLanguage;
use Title;
@ -235,6 +236,11 @@ class ApiVisualEditor extends ApiBase {
case 'parse':
case 'wikitext':
case 'metadata':
// Dirty hack to provide the correct context for FlaggedRevs when it generates edit notices
// and save dialog checkboxes. (T307852)
// FIXME Don't write to globals! Eww.
RequestContext::getMain()->setTitle( $title );
$preloaded = false;
$restbaseHeaders = null;