r91431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91430‎ | r91431 | r91432 >
Date:00:09, 5 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r89617, r91428 call $pager->doQuery explicitally so we get a set result object, from which, we can then get a row count

Expliticly marking doQuery() in pager as public
Modified paths:
  • /trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -142,7 +142,7 @@
143143 * has been kept minimal to make it overridable if necessary, to allow for
144144 * result sets formed from multiple DB queries.
145145 */
146 - function doQuery() {
 146+ public function doQuery() {
147147 # Use the child class name for profiling
148148 $fname = __METHOD__ . ' (' . get_class( $this ) . ')';
149149 wfProfileIn( $fname );
@@ -199,7 +199,7 @@
200200 # Remove any table prefix from index field
201201 $parts = explode( '.', $this->mIndexField );
202202 $indexColumn = end( $parts );
203 -
 203+
204204 $row = $res->fetchRow();
205205 $firstIndex = $row[$indexColumn];
206206
@@ -707,7 +707,9 @@
708708 function getNavigationBar() {
709709 global $wgLang;
710710
711 - if ( !$this->isNavigationBarShown() ) return '';
 711+ if ( !$this->isNavigationBarShown() ) {
 712+ return '';
 713+ }
712714
713715 if ( isset( $this->mNavigationBar ) ) {
714716 return $this->mNavigationBar;
@@ -1002,7 +1004,7 @@
10031005 */
10041006 function getLimitSelect() {
10051007 global $wgLang;
1006 -
 1008+
10071009 # Add the current limit from the query string
10081010 # to avoid that the limit is lost after clicking Go next time
10091011 if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) {
Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php
@@ -202,6 +202,7 @@
203203 }
204204
205205 $pager = new AbuseLogPager( $this, $conds );
 206+ $pager->doQuery();
206207 $result = $pager->getResult();
207208 if( $result && $result->numRows() !== 0 ) {
208209 $wgOut->addHTML( $pager->getNavigationBar() .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89617* (bug 28695) If there are no results for an abuse filter log, can you put "N...reedy23:46, 6 June 2011
r91428Followup r89617...reedy22:00, 4 July 2011

Status & tagging log