From 937c30f5829485d35ebb729f57a299922dd3bfb2 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 19 Nov 2011 08:51:20 +0000 Subject: [PATCH] Use WikiPage instead of Article --- includes/Import.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/Import.php b/includes/Import.php index 6eec5c9ac6..bc02669429 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -1246,14 +1246,14 @@ class WikiRevision { $linkCache = LinkCache::singleton(); $linkCache->clear(); - $article = new Article( $this->title ); - $pageId = $article->getId(); - if( $pageId == 0 ) { + $page = WikiPage::factory( $this->title ); + if( !$page->exists() ) { # must create the page... - $pageId = $article->insertOn( $dbw ); + $pageId = $page->insertOn( $dbw ); $created = true; $oldcountable = null; } else { + $pageId = $page->getId(); $created = false; $prior = $dbw->selectField( 'revision', '1', @@ -1269,7 +1269,7 @@ class WikiRevision { $this->title->getPrefixedText() . "]], timestamp " . $this->timestamp . "\n" ); return false; } - $oldcountable = $article->isCountable(); + $oldcountable = $page->isCountable(); } # @todo FIXME: Use original rev_id optionally (better for backups) @@ -1284,11 +1284,11 @@ class WikiRevision { 'minor_edit' => $this->minor, ) ); $revision->insertOn( $dbw ); - $changed = $article->updateIfNewerOn( $dbw, $revision ); + $changed = $page->updateIfNewerOn( $dbw, $revision ); if ( $changed !== false && !$this->mNoUpdates ) { wfDebug( __METHOD__ . ": running updates\n" ); - $article->doEditUpdates( $revision, $userObj, array( 'created' => $created, 'oldcountable' => $oldcountable ) ); + $page->doEditUpdates( $revision, $userObj, array( 'created' => $created, 'oldcountable' => $oldcountable ) ); } return true; -- 2.20.1