X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2Fpagers%2FDeletedContribsPager.php;h=43d7ad40c7b5116a223e7f7918eab4a7d805125c;hp=2425dd529af4bf8f7f0c6c9557c2af99d1c4102f;hb=36395150104588f2afea866c330b683e4329fa48;hpb=4c5e3357f16be0d2e05bbd27d6cdcae148581b8b diff --git a/includes/specials/pagers/DeletedContribsPager.php b/includes/specials/pagers/DeletedContribsPager.php index 2425dd529a..43d7ad40c7 100644 --- a/includes/specials/pagers/DeletedContribsPager.php +++ b/includes/specials/pagers/DeletedContribsPager.php @@ -23,6 +23,8 @@ * @ingroup Pager */ use MediaWiki\MediaWikiServices; +use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\FakeResultWrapper; class DeletedContribsPager extends IndexPager { @@ -127,7 +129,7 @@ class DeletedContribsPager extends IndexPager { $condition = []; $condition['ar_user_text'] = $this->target; - $index = 'usertext_timestamp'; + $index = 'ar_usertext_timestamp'; return [ $index, $condition ]; } @@ -193,6 +195,7 @@ class DeletedContribsPager extends IndexPager { function formatRow( $row ) { $ret = ''; $classes = []; + $attribs = []; /* * There may be more than just revision rows. To make sure that we'll only be processing @@ -211,17 +214,20 @@ class DeletedContribsPager extends IndexPager { MediaWiki\restoreWarnings(); if ( $validRevision ) { + $attribs['data-mw-revid'] = $rev->getId(); $ret = $this->formatRevisionRow( $row ); } // Let extensions add data - Hooks::run( 'DeletedContributionsLineEnding', [ $this, &$ret, $row, &$classes ] ); + Hooks::run( 'DeletedContributionsLineEnding', [ $this, &$ret, $row, &$classes, &$attribs ] ); + $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] ); - if ( $classes === [] && $ret === '' ) { + if ( $classes === [] && $attribs === [] && $ret === '' ) { wfDebug( "Dropping Special:DeletedContribution row that could not be formatted\n" ); $ret = "\n"; } else { - $ret = Html::rawElement( 'li', [ 'class' => $classes ], $ret ) . "\n"; + $attribs['class'] = $classes; + $ret = Html::rawElement( 'li', $attribs, $ret ) . "\n"; } return $ret;