r19228 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19227‎ | r19228 | r19229 >
Date:12:03, 14 January 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 8632) Fix regression in page protection null edit update
r19095 removed the code that updated the page record's cache timestamp and revision number, leaving the wrong page_latest reference.
Putting it back, merging in the other query to clean out the old page_restrictions field.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1673,7 +1673,7 @@
16741674 if( $protect )
16751675 $comment .= " [$updated]";
16761676 $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
1677 - $nullRevision->insertOn( $dbw );
 1677+ $nullRevId = $nullRevision->insertOn( $dbw );
16781678
16791679 # Update restrictions table
16801680 foreach( $limit as $action => $restrictions ) {
@@ -1687,11 +1687,16 @@
16881688 }
16891689 }
16901690
1691 - # Blank page_restrictions on page record if they're being used.
1692 - if ($this->mTitle->mOldRestrictions) {
1693 - $dbw->update( 'page', array ( 'page_restrictions' => '' ), array ( 'page_id' => $id ), __METHOD__ );
1694 - }
1695 -
 1691+ # Update page record
 1692+ $dbw->update( 'page',
 1693+ array( /* SET */
 1694+ 'page_touched' => $dbw->timestamp(),
 1695+ 'page_restrictions' => '',
 1696+ 'page_latest' => $nullRevId
 1697+ ), array( /* WHERE */
 1698+ 'page_id' => $id
 1699+ ), 'Article::protect'
 1700+ );
16961701 wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) );
16971702
16981703 # Update the protection log
Index: trunk/phase3/RELEASE-NOTES
@@ -65,6 +65,7 @@
6666 * Unmaintained Oracle support files have been removed.
6767 * Made Linker::userToolLinks() show the contribs link red when the user has zero edits
6868 * Use browser default for printing size, don't force to 11pt
 69+* (bug 8632) Fix regression in page protection null edit update
6970
7071
7172 == Languages updated ==

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r19095Merge from branches/werdna/restrictions-separation (forked at r18959): * Bran...werdna23:32, 10 January 2007