r44131 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44130‎ | r44131 | r44132 >
Date:21:59, 1 December 2008
Author:aaron
Status:deferred
Tags:
Comment:
Page id query tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -115,7 +115,9 @@
116116 $options = array();
117117 $row = null;
118118 # Short-circuit query
119 - if( !$title->getArticleId() ) {
 119+ $pageId = $title->getArticleID( $flags & FR_FOR_UPDATE ? GAID_FOR_UPDATE : 0 );
 120+ # Short-circuit query
 121+ if( !$pageId ) {
120122 return null;
121123 }
122124 # User master/slave as appropriate
@@ -123,8 +125,8 @@
124126 $dbr = wfGetDB( DB_SLAVE );
125127 $row = $dbr->selectRow( array('flaggedpages','flaggedrevs'),
126128 $columns,
127 - array( 'fp_page_id' => $title->getArticleId(),
128 - 'fr_page_id' => $title->getArticleId(),
 129+ array( 'fp_page_id' => $pageId,
 130+ 'fr_page_id = fp_page_id',
129131 'fp_stable = fr_rev_id' ),
130132 __METHOD__ );
131133 if( !$row )
@@ -140,7 +142,7 @@
141143 if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) {
142144 $prow = $dbw->selectRow( array('flaggedrevs','revision'),
143145 $columns,
144 - array( 'fr_page_id' => $title->getArticleID(),
 146+ array( 'fr_page_id' => $pageId,
145147 'fr_quality = 2',
146148 'rev_id = fr_rev_id',
147149 'rev_page = fr_page_id',
@@ -158,7 +160,7 @@
159161 "fr_rev_id > {$row->fr_rev_id}" : "1 = 1";
160162 $qrow = $dbw->selectRow( array('flaggedrevs','revision'),
161163 $columns,
162 - array( 'fr_page_id' => $title->getArticleID(),
 164+ array( 'fr_page_id' => $pageId,
163165 'fr_quality = 1',
164166 $newerClause,
165167 'rev_id = fr_rev_id',
@@ -172,7 +174,7 @@
173175 if( !$row ) {
174176 $row = $dbw->selectRow( array('flaggedrevs','revision'),
175177 $columns,
176 - array( 'fr_page_id' => $title->getArticleID(),
 178+ array( 'fr_page_id' => $pageId,
177179 'rev_id = fr_rev_id',
178180 'rev_page = fr_page_id',
179181 'rev_deleted & '.Revision::DELETED_TEXT => 0),

Status & tagging log