EditPage: Don't show create label for the button on new sections
It turns out that the helpful $this->isNew is true on new section edits, whether or not the page exists, so instead we have to fall back on the $this->mTitle->exists() call that partially populates isNew anyway. Change-Id: I7d7cdecda51c6ab4b05496f0b1420cb0264fcccb
This commit is contained in:
parent
bc335c231d
commit
d7da3e4452
1 changed files with 3 additions and 2 deletions
|
|
@ -4070,10 +4070,11 @@ HTML
|
|||
$buttons = [];
|
||||
|
||||
$labelAsPublish = $this->mArticle->getContext()->getConfig()->get( 'EditButtonPublishNotSave' );
|
||||
// Can't use $this->isNew as that's also true if we're adding a new section to an extant page
|
||||
if ( $labelAsPublish ) {
|
||||
$buttonLabelKey = $this->isNew ? 'publishpage' : 'publishchanges';
|
||||
$buttonLabelKey = !$this->mTitle->exists() ? 'publishpage' : 'publishchanges';
|
||||
} else {
|
||||
$buttonLabelKey = $this->isNew ? 'savearticle' : 'savechanges';
|
||||
$buttonLabelKey = !$this->mTitle->exists() ? 'savearticle' : 'savechanges';
|
||||
}
|
||||
$buttonLabel = wfMessage( $buttonLabelKey )->text();
|
||||
$attribs = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue