From: Brion Vibber Date: Mon, 3 Dec 2007 19:16:56 +0000 (+0000) Subject: * Graceful behavior for updateRestrictions.php if a page already has records X-Git-Tag: 1.31.0-rc.0~50571 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=d7b8f505199d8be1bc2abfe5705c1b7d500f5989;p=lhc%2Fweb%2Fwiklou.git * 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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fd07d25932..caf62ac1e6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index 9503d0b787..c8cebfc48d 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -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;