mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
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:
parent
1eeab91220
commit
3ec5e04a37
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue