From: Brion Vibber Date: Thu, 30 Jun 2005 06:51:43 +0000 (+0000) Subject: * (bug 2618) Fix regression from another fix; show initial preview for X-Git-Tag: 1.5.0beta2~121 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24www_url%7Dadmin/config?a=commitdiff_plain;h=9cc44a6aed735d3e73ce188ddff56f7821d6dc90;p=lhc%2Fweb%2Fwiklou.git * (bug 2618) Fix regression from another fix; show initial preview for categories only if the page does not exist. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cc6bcc65b4..7f537f30ae 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -427,6 +427,8 @@ Various bugfixes, small features, and a few experimental things: Also fix navigation links on current-with-oldid view. * (bug 2620) Return to prior behavior for some more things (such as subpage parent links) on current-diff view. +* (bug 2618) Fix regression from another fix; show initial preview for + categories only if the page does not exist. === Caveats === diff --git a/includes/EditPage.php b/includes/EditPage.php index 1b53ba1a77..a97558f73b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -181,8 +181,7 @@ class EditPage { } else if ( $this->diff ) { $this->editForm( 'diff' ); } else { # First time through - if( $wgUser->getOption('previewonfirst') - or $this->mTitle->getNamespace() == NS_CATEGORY ) { + if( $this->previewOnOpen() ) { $this->editForm( 'preview', true ); } else { $this->extractMetaDataFromArticle () ; @@ -190,6 +189,19 @@ class EditPage { } } } + + /** + * Return true if this page should be previewed when the edit form + * is initially opened. + * @return bool + * @access private + */ + function previewOnOpen() { + global $wgUser; + return $wgUser->getOption( 'previewonfirst' ) || + ( $this->mTitle->getNamespace() == NS_CATEGORY && + !$this->mTitle->exists() ); + } /** * @todo document