From 11af806c190a8ffcb7897928c39ba08e3d51ab44 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 24 Dec 2004 09:51:36 +0000 Subject: [PATCH] * Fix revert bug caused by bug 1175 fix --- includes/EditPage.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 07d01c1a13..3a8e3b7f86 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -74,11 +74,10 @@ class EditPage { } else if ( $this->preview ) { $this->editForm( 'preview' ); } else { # First time through - $this->initForm(); if( $wgUser->getOption('previewonfirst') ) { - $this->editForm( 'preview' ); + $this->editForm( 'preview', true ); } else { - $this->editForm( 'initial' ); + $this->editForm( 'initial', true ); } } } @@ -131,8 +130,9 @@ class EditPage { * the newly-edited page. * * @param string $formtype Type of form either : save, initial or preview + * @param bool $firsttime True to load form data from db */ - function editForm( $formtype ) { + function editForm( $formtype, $firsttime = false ) { global $wgOut, $wgUser; global $wgLang, $wgContLang, $wgParser, $wgTitle; global $wgAllowAnonymousMinor; @@ -276,8 +276,11 @@ class EditPage { # First time through: get contents, set time for conflict # checking, etc. - if ( 'initial' == $formtype ) { - $this->initForm(); + if ( 'initial' == $formtype || $firsttime ) { + $this->edittime = $this->mArticle->getTimestamp(); + $this->textbox1 = $this->mArticle->getContent( true ); + $this->summary = ''; + $this->proxyCheck(); } $wgOut->setRobotpolicy( 'noindex,nofollow' ); @@ -515,16 +518,6 @@ END $wgOut->addHTML('
' . $previewOutput . '
'); } } - - /** - * @todo document - */ - function initForm() { - $this->edittime = $this->mArticle->getTimestamp(); - $this->textbox1 = $this->mArticle->getContent( true ); - $this->summary = ''; - $this->proxyCheck(); - } function getPreviewText( $isConflict, $isCssJsSubpage ) { global $wgOut, $wgUser, $wgTitle, $wgParser; -- 2.20.1