Fix bug 32948:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 21 Jan 2012 07:59:25 +0000 (07:59 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 21 Jan 2012 07:59:25 +0000 (07:59 +0000)
* {{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

RELEASE-NOTES-1.19
includes/Revision.php
includes/WikiPage.php
includes/api/ApiPurge.php

index 1e6ddb7..3e109d9 100644 (file)
@@ -230,6 +230,8 @@ production.
 * (bug 4438) Add CSS hook for current WikiPage action.
 * (bug 33703) Common border-bottom color for <abbr> should inherit default (text) color.
 * (bug 33819) Display file sizes in appropriate units.
+* (bug 32948) {{REVISIONID}} and related variables are no longer blank after doing
+  a null edit.
 
 === API changes in 1.19 ===
 * Made action=edit less likely to return "unknownerror", by returning the actual error
@@ -262,6 +264,8 @@ production.
 * (bug 33147) API examples should explain what they do.
 * (bug 33482) Api incorrectly calls ApiBase::parseMultiValue if allowed
   values is given as an array.
+* (bug 32948) {{REVISIONID}} and related variables are no longer blank after
+  calling action=purge&forcelinkupdate.
 
 === Languages updated in 1.19 ===
 
index e14471e..ba28999 100644 (file)
@@ -474,6 +474,16 @@ class Revision {
                return $this->mId;
        }
 
+       /**
+        * Set the revision ID
+        *
+        * @since 1.19
+        * @param $id Integer
+        */
+       public function setId( $id ) {
+               $this->mId = $id;
+       }
+
        /**
         * Get text row ID
         *
index 0395471..8d5d606 100644 (file)
@@ -1348,6 +1348,10 @@ class WikiPage extends Page {
                                        $user->incEditCount();
                                        $dbw->commit();
                                }
+                       } else {
+                               // Bug 32948: revision ID must be set to page {{REVISIONID}} and
+                               // related variables correctly
+                               $revision->setId( $this->getLatest() );
                        }
 
                        if ( !$wgDBtransactions ) {
@@ -1367,8 +1371,6 @@ class WikiPage extends Page {
                        if ( !$changed ) {
                                $status->warning( 'edit-no-change' );
                                $revision = null;
-                               // Keep the same revision ID, but do some updates on it
-                               $revisionId = $this->getLatest();
                                // Update page_touched, this is usually implicit in the page update
                                // Other cache updates are done in onArticleEdit()
                                $this->mTitle->invalidateCache();
index dfa7229..9e9320f 100644 (file)
@@ -89,7 +89,8 @@ class ApiPurge extends ApiBase {
                                        global $wgParser, $wgEnableParserCache;
 
                                        $popts = ParserOptions::newFromContext( $this->getContext() );
-                                       $p_result = $wgParser->parse( $page->getRawText(), $title, $popts );
+                                       $p_result = $wgParser->parse( $page->getRawText(), $title, $popts,
+                                               true, true, $page->getLatest() );
 
                                        # Update the links tables
                                        $u = new LinksUpdate( $title, $p_result );