From 2993c377e60157fd88336fd5d60716192ddce8d8 Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 26 Oct 2016 16:43:50 +0200 Subject: [PATCH] Move condition to not show form one level up This condition to abort the show form process was more or less hidden in the header method. The returned boolean was used nowhere else. Change-Id: I91335deac0547c24d107305a2ded503c9ab15090 --- includes/EditPage.php | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 4aa87d6c89..7d1cf1d66e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2620,10 +2620,21 @@ ERROR; $this->setHeaders(); - if ( $this->showHeader() === false ) { + $this->addTalkPageText(); + $this->addEditNotices(); + + if ( !$this->isConflict && + $this->section != '' && + !$this->isSectionEditSupported() ) { + // We use $this->section to much before this and getVal('wgSection') directly in other places + // at this point we can't reset $this->section to '' to fallback to non-section editing. + // Someone is welcome to try refactoring though + $wgOut->showErrorPage( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' ); return; } + $this->showHeader(); + $wgOut->addHTML( $this->editFormPageTop ); if ( $wgUser->getOption( 'previewontop' ) ) { @@ -2878,29 +2889,14 @@ ERROR; } } - /** - * @return bool - */ protected function showHeader() { global $wgOut, $wgUser, $wgMaxArticleSize, $wgLang; global $wgAllowUserCss, $wgAllowUserJs; - $this->addTalkPageText(); - - $this->addEditNotices(); - if ( $this->isConflict ) { $wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' ); $this->editRevId = $this->page->getLatest(); } else { - if ( $this->section != '' && !$this->isSectionEditSupported() ) { - // We use $this->section to much before this and getVal('wgSection') directly in other places - // at this point we can't reset $this->section to '' to fallback to non-section editing. - // Someone is welcome to try refactoring though - $wgOut->showErrorPage( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' ); - return false; - } - if ( $this->section != '' && $this->section != 'new' ) { if ( !$this->summary && !$this->preview && !$this->diff ) { $sectionTitle = self::extractSectionTitle( $this->textbox1 ); // FIXME: use Content object @@ -3087,8 +3083,6 @@ ERROR; } # Add header copyright warning $this->showHeaderCopyrightWarning(); - - return true; } /** -- 2.20.1