From: Alexandre Emsenhuber Date: Wed, 14 Jan 2009 18:07:03 +0000 (+0000) Subject: (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if the... X-Git-Tag: 1.31.0-rc.0~43428 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=3048701f8636ab79dbb7f3f29e637252462cb4c1;p=lhc%2Fweb%2Fwiklou.git (bug 17010) maintenance/namespaceDupes.php now add the suffix recursively if the destination page exists --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ba50caf875..e709d3d85f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index fcc7d3a12c..c5b3ce9681 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -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"; }