| Index: trunk/phase3/includes/specials/SpecialContributions.php |
| — | — | @@ -64,6 +64,8 @@ |
| 65 | 65 | $this->opts['namespace'] = ''; |
| 66 | 66 | } |
| 67 | 67 | |
| | 68 | + $this->opts['deletedOnly'] = ( $wgRequest->getVal( 'deletedOnly' ) == '1' ); |
| | 69 | + |
| 68 | 70 | $this->opts['tagfilter'] = (string) $wgRequest->getVal( 'tagfilter' ); |
| 69 | 71 | |
| 70 | 72 | // Allows reverts to have the bot flag in recent changes. It is just here to |
| — | — | @@ -93,7 +95,8 @@ |
| 94 | 96 | |
| 95 | 97 | $wgOut->addHTML( $this->getForm() ); |
| 96 | 98 | |
| 97 | | - $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] ); |
| | 99 | + $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], |
| | 100 | + $this->opts['month'], false, $this->opts['deletedOnly'] ); |
| 98 | 101 | if( !$pager->getNumRows() ) { |
| 99 | 102 | $wgOut->addWikiMsg( 'nocontribs', $target ); |
| 100 | 103 | } else { |
| — | — | @@ -296,9 +299,11 @@ |
| 297 | 300 | } |
| 298 | 301 | |
| 299 | 302 | $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 300 | | - # Add hidden params for tracking |
| | 303 | + |
| | 304 | + # Add hidden params for tracking except for parameters in $skipParameters |
| | 305 | + $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month' ); |
| 301 | 306 | foreach ( $this->opts as $name => $value ) { |
| 302 | | - if( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) { |
| | 307 | + if( in_array( $name, $skipParameters ) ) { |
| 303 | 308 | continue; |
| 304 | 309 | } |
| 305 | 310 | $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; |
| — | — | @@ -320,6 +325,8 @@ |
| 321 | 326 | Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . |
| 322 | 327 | Xml::namespaceSelector( $this->opts['namespace'], '' ) . |
| 323 | 328 | '</span>' . |
| | 329 | + Xml::checkLabel( wfMsg( 'history-show-deleted' ), |
| | 330 | + 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . |
| 324 | 331 | ( $tagFilter ? Xml::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) . |
| 325 | 332 | Xml::openElement( 'p' ) . |
| 326 | 333 | '<span style="white-space: nowrap">' . |
| — | — | @@ -367,7 +374,7 @@ |
| 368 | 375 | $target = $this->opts['target'] == 'newbies' ? 'newbies' : $nt->getText(); |
| 369 | 376 | |
| 370 | 377 | $pager = new ContribsPager( $target, $this->opts['namespace'], |
| 371 | | - $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'] ); |
| | 378 | + $this->opts['year'], $this->opts['month'], $this->opts['tagfilter'], $this->opts['deletedOnly'] ); |
| 372 | 379 | |
| 373 | 380 | $pager->mLimit = min( $this->opts['limit'], $wgFeedLimit ); |
| 374 | 381 | |
| — | — | @@ -431,7 +438,7 @@ |
| 432 | 439 | var $messages, $target; |
| 433 | 440 | var $namespace = '', $mDb; |
| 434 | 441 | |
| 435 | | - function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) { |
| | 442 | + function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false, $deletedOnly = false ) { |
| 436 | 443 | parent::__construct(); |
| 437 | 444 | |
| 438 | 445 | $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' ); |
| — | — | @@ -443,6 +450,7 @@ |
| 444 | 451 | $this->target = $target; |
| 445 | 452 | $this->namespace = $namespace; |
| 446 | 453 | $this->tagFilter = $tagFilter; |
| | 454 | + $this->deletedOnly = $deletedOnly; |
| 447 | 455 | |
| 448 | 456 | $this->getDateCond( $year, $month ); |
| 449 | 457 | |
| — | — | @@ -510,6 +518,9 @@ |
| 511 | 519 | $condition['rev_user_text'] = $this->target; |
| 512 | 520 | $index = 'usertext_timestamp'; |
| 513 | 521 | } |
| | 522 | + if ( $this->deletedOnly ) { |
| | 523 | + $condition[] = "rev_deleted != '0'"; |
| | 524 | + } |
| 514 | 525 | return array( $tables, $index, $condition, $join_conds ); |
| 515 | 526 | } |
| 516 | 527 | |
| — | — | @@ -673,4 +684,15 @@ |
| 674 | 685 | return $this->mDb; |
| 675 | 686 | } |
| 676 | 687 | |
| | 688 | + /** |
| | 689 | + * Overwrite Pager function and return a helpful comment |
| | 690 | + */ |
| | 691 | + function getSqlComment() { |
| | 692 | + if ( $this->namespace || $this->deletedOnly ) { |
| | 693 | + return 'contributions page filtered for namespace or RevisionDeleted edits'; // potentially slow, see CR r58153 |
| | 694 | + } else { |
| | 695 | + return 'contributions page unfiltered'; |
| | 696 | + } |
| | 697 | + } |
| | 698 | + |
| 677 | 699 | } |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -54,6 +54,7 @@ |
| 55 | 55 | * (bug 22647) Add category details in search results. |
| 56 | 56 | * (bug 23276) Add hook to Special:NewPages to modify query |
| 57 | 57 | * Add accesskey 's' and tooltip to 'Save' button at Special:Preferences |
| | 58 | +* (bug 20186) Allow filtering Special:Contributions for RevisionDeleted edits |
| 58 | 59 | |
| 59 | 60 | === Bug fixes in 1.17 === |
| 60 | 61 | * (bug 17560) Half-broken deletion moved image files to deletion archive |