r108871 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108870‎ | r108871 | r108872 >
Date:22:59, 13 January 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Revert most of r108602

For such a minor cosmetic fix, having to do a query per result row is just daft
Modified paths:
  • /trunk/extensions/Nuke/Nuke.php (modified) (history)
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -159,7 +159,7 @@
160160
161161 foreach( $pages as $info ) {
162162 /**
163 - * @var $title title
 163+ * @var $title Title
164164 */
165165 list( $title, $edits, $userName ) = $info;
166166
@@ -203,6 +203,7 @@
204204 'rc_namespace',
205205 'rc_title',
206206 'rc_timestamp',
 207+ 'COUNT(*) AS edits'
207208 );
208209
209210 $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" );
@@ -232,24 +233,9 @@
233234 $pages = array();
234235
235236 foreach ( $result as $row ) {
236 - // Note: 'COUNT(*) AS edits' here does not work. For some unknown reason,
237 - // there sometimes are duplicate entries in recentchanges (possibly caused by importing stuff).
238 - $resultEdits = $dbr->select(
239 - 'recentchanges',
240 - array(
241 - 'rc_timestamp',
242 - ),
243 - array(
244 - 'rc_title' => $row->rc_title,
245 - 'rc_namespace' => $row->rc_namespace,
246 - ),
247 - __METHOD__,
248 - array( 'DISTINCT' )
249 - );
250 -
251237 $pages[] = array(
252238 Title::makeTitle( $row->rc_namespace, $row->rc_title ),
253 - $resultEdits->numRows(),
 239+ $row->edits,
254240 $username == '' ? $row->rc_user_text : false
255241 );
256242 }
Index: trunk/extensions/Nuke/Nuke.php
@@ -4,7 +4,7 @@
55 die( 'Not an entry point.' );
66 }
77
8 -define( 'Nuke_VERSION', '1.1.4' );
 8+define( 'Nuke_VERSION', '1.1.3' );
99
1010 $dir = dirname(__FILE__) . '/';
1111

Follow-up revisions

RevisionCommit summaryAuthorDate
r111298Follow up to r108871; -mjeroendedauw14:45, 12 February 2012
r113604bug 16985: Show number of recent edits in Special:Nuke...saper00:18, 12 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108602fix bug 16985 based on attached patch by Nakonjeroendedauw09:34, 11 January 2012

Comments

#Comment by Jeroen De Dauw (talk | contribs)   10:11, 14 January 2012

In that case it's probably better to not show the amount of edits, rather then the wrong amount. Unless of course someone knows how to get this count in a better way...

#Comment by Reedy (talk | contribs)   13:56, 14 January 2012

Indeed...

Status & tagging log