NWE: Pre-populate editor when editing system messages

This is the same behaviour as EditPage.php

Bug: T256999
Change-Id: Id33161982742c16222ba5d58d2e800ab04dccca2
This commit is contained in:
Ed Sanders 2020-07-02 21:46:52 +01:00 committed by Bartosz Dziewoński
parent 1eeab91220
commit 3ec5e04a37

View file

@ -233,8 +233,11 @@ class ApiVisualEditor extends ApiBase {
}
} else {
$content = '';
if ( $title->getNamespace() == NS_MEDIAWIKI && $params['section'] !== 'new' ) {
// If this is a system message, get the default text.
$content = $title->getDefaultMessageText();
}
Hooks::run( 'EditFormPreloadText', [ &$content, &$title ] );
// @phan-suppress-next-line PhanSuspiciousValueComparison Known false positive with hooks
if ( $content === '' && !empty( $params['preload'] ) ) {
$content = $this->getPreloadContent(
$params['preload'], $params['preloadparams'], $title