From: Alexandre Emsenhuber Date: Sat, 21 Jan 2012 07:59:25 +0000 (+0000) Subject: Fix bug 32948: X-Git-Tag: 1.31.0-rc.0~25152 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=b1d0376c1e21c25ddf19b6ac8f9eba879362a146;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 1e6ddb7758..3e109d960b 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -230,6 +230,8 @@ production. * (bug 4438) Add CSS hook for current WikiPage action. * (bug 33703) Common border-bottom color for 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 === diff --git a/includes/Revision.php b/includes/Revision.php index e14471e21f..ba28999d6b 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -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 * diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 039547196c..8d5d60646d 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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(); diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index dfa7229e96..9e9320fb6c 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -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 );