(bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if the...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 14 Jan 2009 18:07:03 +0000 (18:07 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 14 Jan 2009 18:07:03 +0000 (18:07 +0000)
RELEASE-NOTES
maintenance/namespaceDupes.php

index ba50caf..e709d3d 100644 (file)
@@ -39,12 +39,17 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 16852) padleft and padright now accept multiletter pad characters
   
 === Bug fixes in 1.15 ===
-* Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class)
-* Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class)
+* Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with
+  LanguageConverter class)
+* Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with
+  LanguageConverter class)
 * (bug 16968) Special:Upload no longer throws useless warnings.
 * (bug 15470) Special:Upload no longer force-capitalizes titles
-* (bug 17000) Special:RevisionDelete now checks if the database is locked before trying to delete the edit.
+* (bug 17000) Special:RevisionDelete now checks if the database is locked before
+  trying to delete the edit.
 * (bug 16852) padleft and padright now handle multibyte characters correctly
+* (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if
+  the destination page exists
 
 == API changes in 1.15 ==
 * (bug 16798) JSON encoding errors for some characters outside the BMP
index fcc7d3a..c5b3ce9 100644 (file)
@@ -224,12 +224,19 @@ class NamespaceConflictChecker {
        function resolveConflict( $row, $resolvable, $suffix ) {
                if( !$resolvable ) {
                        echo "...  *** old title {$row->title}\n";
-                       $row->title .= $suffix;
-                       echo "...  *** new title {$row->title}\n";
-                       $title = Title::makeTitleSafe( $row->namespace, $row->title );
-                       if ( ! $title ) {
-                               echo "... !!! invalid title\n";
-                               return false;
+                       while( true ) {
+                               $row->title .= $suffix;
+                               echo "...  *** new title {$row->title}\n";
+                               $title = Title::makeTitleSafe( $row->namespace, $row->title );
+                               if ( ! $title ) {
+                                       echo "... !!! invalid title\n";
+                                       return false;
+                               }
+                               if ( $id = $title->getArticleId() ) {
+                                       echo "...  *** page exists with ID $id ***\n";
+                               } else {        
+                                       break;
+                               }
                        }
                        echo "...  *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n";
                }