r107848 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107847‎ | r107848 | r107849 >
Date:19:54, 2 January 2012
Author:ialex
Status:deferred
Tags:
Comment:
* Use accessor to get the latest revision of a page
* Load page data before calling Title::exists() so that we don't need to load the data twice
* Removed useless members and method from SpecialSignDocument
Modified paths:
  • /trunk/extensions/SignDocument/SignDocumentHelpers.php (modified) (history)
  • /trunk/extensions/SignDocument/SpecialSignDocument.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SignDocument/SpecialSignDocument.php
@@ -10,9 +10,6 @@
1111 */
1212 private $mDocumentId;
1313
14 - private $mArticle;
15 - private $mTitle;
16 -
1714 private $mCurrentSig;
1815 private $mForm;
1916
@@ -254,11 +251,6 @@
255252 return $out;
256253 }
257254
258 - function loadDocument() {
259 - $this->mTitle = Title::newFromId( 1 );
260 - $this->mArticle = new Article( $this->mTitle );
261 - }
262 -
263255 function dealWithPost() {
264256 $this->doSigning();
265257 }
Index: trunk/extensions/SignDocument/SignDocumentHelpers.php
@@ -96,13 +96,13 @@
9797 throw new MWException( 'Something went horribly wrong. ' .
9898 'mTitle is null or not an object.' );
9999
 100+ $this->mArticle = new Article( $this->mTitle );
 101+ $this->mArticle->loadPageData();
 102+
100103 if ( !$this->mTitle->exists() )
101104 return false;
102105
103 - $this->mArticle = new Article( $this->mTitle );
104 - $this->mArticle->loadPageData();
105 -
106 - $this->mOldid = $this->mArticle->mLatest;
 106+ $this->mOldid = $this->mTitle->getLatestRevID();
107107 $this->mPageId = $this->mTitle->getArticleID();
108108
109109 return true;

Status & tagging log