r44427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44426‎ | r44427 | r44428 >
Date:22:41, 10 December 2008
Author:brion
Status:ok
Tags:
Comment:
Attempting to import a title that came out as an interwiki would sort of half-work somewhere then explode when trying to save the null revision with the import info:
Fatal error: Call to a member function insertOn() on a non-object in /Library/WebServer/Documents/trunk/includes/specials/SpecialImport.php on line 305

Now such titles are skipped. You can probably force import of the page by forcing the target namespace...

Better long-term solution might include title renormalization, adapation of remote namespace names (eg Wikipedia -> Project), etc.
Modified paths:
  • /trunk/phase3/includes/Import.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Import.php
@@ -776,6 +776,9 @@
777777 if( is_null( $this->pageTitle ) ) {
778778 // Invalid page title? Ignore the page
779779 $this->notice( "Skipping invalid page title '$this->workTitle'" );
 780+ } elseif( $this->pageTitle->getInterwiki() != '' ) {
 781+ $this->notice( "Skipping interwiki page title '$this->workTitle'" );
 782+ $this->pageTitle = null;
780783 } else {
781784 $this->pageCallback( $this->workTitle );
782785 }

Status & tagging log