From: umherirrender Date: Sat, 7 Apr 2012 12:40:01 +0000 (+0200) Subject: (bug 33564) transwiki import sometimes result in invalid title X-Git-Tag: 1.31.0-rc.0~23956 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=6ffe70604441f3bdbaeaecce53ee2ae54b40c0fb;p=lhc%2Fweb%2Fwiklou.git (bug 33564) transwiki import sometimes result in invalid title This is a simple fix. A other solution is to check isExternal on the original title, but than it is never possible to import pages, which have a interwiki in the destination wiki. Now the interwiki is skipped, when using a target namespace. Change-Id: I148e124016cacac0e0c6c6eb8c7e8a2e85802565 --- diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 0b6cd177e0..0e8cdc09e6 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -79,6 +79,7 @@ production. * (bug 35069) On history pages, the " . . " separator after the number of characters changed in a revision is now suppressed if no text would follow. * (bug 18704) Add a unique CSS class or ID to the tagfilter table row at RecentChanges +* (bug 33564) transwiki import sometimes result in invalid title. === API changes in 1.20 === * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. diff --git a/includes/Import.php b/includes/Import.php index 607d878b59..9ebc34c91b 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -786,7 +786,9 @@ class WikiImporter { $origTitle = Title::newFromText( $workTitle ); if( !is_null( $this->mTargetNamespace ) && !is_null( $origTitle ) ) { - $title = Title::makeTitle( $this->mTargetNamespace, + # makeTitleSafe, because $origTitle can have a interwiki (different setting of interwiki map) + # and than dbKey can begin with a lowercase char + $title = Title::makeTitleSafe( $this->mTargetNamespace, $origTitle->getDBkey() ); } else { $title = Title::newFromText( $workTitle );