Index: trunk/extensions/Nuke/Nuke_body.php |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | } |
9 | 9 | |
10 | 10 | public function execute( $par ) { |
| 11 | + |
11 | 12 | if( !$this->userCanExecute( $this->getUser() ) ) { |
12 | 13 | $this->displayRestrictionError(); |
13 | 14 | return; |
— | — | @@ -184,7 +185,7 @@ |
185 | 186 | $out->addHTML( |
186 | 187 | "</ul>\n" . |
187 | 188 | Xml::submitButton( wfMsg( 'nuke-submit-delete' ) ) . |
188 | | - "</form>" |
| 189 | + '</form>' |
189 | 190 | ); |
190 | 191 | } |
191 | 192 | |
— | — | @@ -203,7 +204,6 @@ |
204 | 205 | 'rc_namespace', |
205 | 206 | 'rc_title', |
206 | 207 | 'rc_timestamp', |
207 | | - 'COUNT(*) AS edits' |
208 | 208 | ); |
209 | 209 | |
210 | 210 | $where = array( "(rc_new = 1) OR (rc_log_type = 'upload' AND rc_log_action = 'upload')" ); |
— | — | @@ -233,11 +233,28 @@ |
234 | 234 | $pages = array(); |
235 | 235 | |
236 | 236 | foreach ( $result as $row ) { |
| 237 | + // Note: 'COUNT(*) AS edits' here does not work. For some unknown reason, |
| 238 | + // there sometimes are duplicate entries in recentchanges (possibly caused by importing stuff). |
| 239 | + $resultEdits = $dbr->select( |
| 240 | + 'recentchanges', |
| 241 | + array( |
| 242 | + 'rc_timestamp', |
| 243 | + ), |
| 244 | + array( |
| 245 | + 'rc_title' => $row->rc_title, |
| 246 | + 'rc_namespace' => $row->rc_namespace, |
| 247 | + ), |
| 248 | + __METHOD__, |
| 249 | + array( 'DISTINCT' ) |
| 250 | + ); |
| 251 | + |
237 | 252 | $pages[] = array( |
238 | 253 | Title::makeTitle( $row->rc_namespace, $row->rc_title ), |
239 | | - $row->edits, |
| 254 | + $resultEdits->numRows(), |
240 | 255 | $username == '' ? $row->rc_user_text : false |
241 | 256 | ); |
| 257 | + |
| 258 | + $dbr->freeResult( $resultEdits ); |
242 | 259 | } |
243 | 260 | |
244 | 261 | return $pages; |
Index: trunk/extensions/Nuke/Nuke.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | die( 'Not an entry point.' ); |
6 | 6 | } |
7 | 7 | |
8 | | -define( 'Nuke_VERSION', '1.1.3' ); |
| 8 | +define( 'Nuke_VERSION', '1.1.4' ); |
9 | 9 | |
10 | 10 | $dir = dirname(__FILE__) . '/'; |
11 | 11 | |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | 'path' => __FILE__, |
17 | 17 | 'name' => 'Nuke', |
18 | 18 | 'descriptionmsg' => 'nuke-desc', |
19 | | - 'author' => 'Brion Vibber', |
| 19 | + 'author' => array( 'Brion Vibber', 'Jeroen De Dauw' ), |
20 | 20 | 'url' => 'https://www.mediawiki.org/wiki/Extension:Nuke', |
21 | 21 | 'version' => Nuke_VERSION, |
22 | 22 | ); |