r109679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109678‎ | r109679 | r109680 >
Date:07:59, 21 January 2012
Author:ialex
Status:ok
Tags:core 
Comment:
Fix bug 32948:
* {{REVISIONID}} and related variables are no longer blank after doing a null edit
* {{REVISIONID}} and related variables are no longer blank after calling action=purge&forcelinkupdate
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPurge.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -230,6 +230,8 @@
231231 * (bug 4438) Add CSS hook for current WikiPage action.
232232 * (bug 33703) Common border-bottom color for <abbr> should inherit default (text) color.
233233 * (bug 33819) Display file sizes in appropriate units.
 234+* (bug 32948) {{REVISIONID}} and related variables are no longer blank after doing
 235+ a null edit.
234236
235237 === API changes in 1.19 ===
236238 * Made action=edit less likely to return "unknownerror", by returning the actual error
@@ -262,6 +264,8 @@
263265 * (bug 33147) API examples should explain what they do.
264266 * (bug 33482) Api incorrectly calls ApiBase::parseMultiValue if allowed
265267 values is given as an array.
 268+* (bug 32948) {{REVISIONID}} and related variables are no longer blank after
 269+ calling action=purge&forcelinkupdate.
266270
267271 === Languages updated in 1.19 ===
268272
Index: trunk/phase3/includes/api/ApiPurge.php
@@ -89,7 +89,8 @@
9090 global $wgParser, $wgEnableParserCache;
9191
9292 $popts = ParserOptions::newFromContext( $this->getContext() );
93 - $p_result = $wgParser->parse( $page->getRawText(), $title, $popts );
 93+ $p_result = $wgParser->parse( $page->getRawText(), $title, $popts,
 94+ true, true, $page->getLatest() );
9495
9596 # Update the links tables
9697 $u = new LinksUpdate( $title, $p_result );
Index: trunk/phase3/includes/Revision.php
@@ -475,6 +475,16 @@
476476 }
477477
478478 /**
 479+ * Set the revision ID
 480+ *
 481+ * @since 1.19
 482+ * @param $id Integer
 483+ */
 484+ public function setId( $id ) {
 485+ $this->mId = $id;
 486+ }
 487+
 488+ /**
479489 * Get text row ID
480490 *
481491 * @return Integer
Index: trunk/phase3/includes/WikiPage.php
@@ -1348,6 +1348,10 @@
13491349 $user->incEditCount();
13501350 $dbw->commit();
13511351 }
 1352+ } else {
 1353+ // Bug 32948: revision ID must be set to page {{REVISIONID}} and
 1354+ // related variables correctly
 1355+ $revision->setId( $this->getLatest() );
13521356 }
13531357
13541358 if ( !$wgDBtransactions ) {
@@ -1367,8 +1371,6 @@
13681372 if ( !$changed ) {
13691373 $status->warning( 'edit-no-change' );
13701374 $revision = null;
1371 - // Keep the same revision ID, but do some updates on it
1372 - $revisionId = $this->getLatest();
13731375 // Update page_touched, this is usually implicit in the page update
13741376 // Other cache updates are done in onArticleEdit()
13751377 $this->mTitle->invalidateCache();

Sign-offs

UserFlagDate
Nikerabbitinspected17:15, 21 January 2012

Status & tagging log