* Graceful behavior for updateRestrictions.php if a page already has records
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 3 Dec 2007 19:16:56 +0000 (19:16 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 3 Dec 2007 19:16:56 +0000 (19:16 +0000)
  in the page_restrictions matching its old page_restrictions field.
  May help with odd upgrade issues or race condition.

RELEASE-NOTES
maintenance/updateRestrictions.php

index fd07d25..caf62ac 100644 (file)
@@ -207,6 +207,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   instead of a Traditional conversion with Taiwan variant, and a Simplified 
   conversion with China variant.
 * (bug 12178) Fix wpReason parameter to action=delete, again.
+* Graceful behavior for updateRestrictions.php if a page already has records
+  in the page_restrictions matching its old page_restrictions field.
+  May help with odd upgrade issues or race condition.
+
 
 == Parser changes in 1.12 ==
 
index 9503d0b..c8cebfc 100644 (file)
@@ -56,7 +56,7 @@ function migrate_page_restrictions( $db ) {
                # We use insert() and not replace() as Article.php replaces
                # page_restrictions with '' when protected in the restrictions table
                if ( count( $batch ) ) {
-                       $db->insert( 'page_restrictions', $batch, __FUNCTION__ );
+                       $db->insert( 'page_restrictions', $batch, __FUNCTION__, array( 'IGNORE' ) );
                }
                $blockStart += BATCH_SIZE;
                $blockEnd += BATCH_SIZE;