Merge "MediaSearchWidget: Only resize new results"
[lhc/web/wiklou.git] / includes / specials / pagers / ContribsPager.php
index 5126bad..ea93f1f 100644 (file)
@@ -26,6 +26,7 @@
 use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\ResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 class ContribsPager extends ReverseChronologicalPager {
 
@@ -44,6 +45,11 @@ class ContribsPager extends ReverseChronologicalPager {
         */
        protected $mParentLens;
 
+       /**
+        * @var TemplateParser
+        */
+       protected $templateParser;
+
        function __construct( IContextSource $context, array $options ) {
                parent::__construct( $context );
 
@@ -79,6 +85,7 @@ class ContribsPager extends ReverseChronologicalPager {
                // queries should use a regular replica DB since the lookup pattern is not all by user.
                $this->mDbSecondary = wfGetDB( DB_REPLICA ); // any random replica DB
                $this->mDb = wfGetDB( DB_REPLICA, 'contributions' );
+               $this->templateParser = new TemplateParser();
        }
 
        function getDefaultQuery() {
@@ -227,10 +234,8 @@ class ContribsPager extends ReverseChronologicalPager {
                                        'LEFT JOIN', [
                                                'ug_user = rev_user',
                                                'ug_group' => $groupsWithBotPermission,
-                                               $this->getConfig()->get( 'DisableUserGroupExpiry' ) ?
-                                                       '1' :
-                                                       'ug_expiry IS NULL OR ug_expiry >= ' .
-                                                               $this->mDb->addQuotes( $this->mDb->timestamp() )
+                                               'ug_expiry IS NULL OR ug_expiry >= ' .
+                                                       $this->mDb->addQuotes( $this->mDb->timestamp() )
                                        ]
                                ];
                        }
@@ -517,8 +522,7 @@ class ContribsPager extends ReverseChronologicalPager {
                                        $this->msg( 'rev-deleted-user-contribs' )->escaped();
                        }
 
-                       $templateParser = new TemplateParser();
-                       $ret = $templateParser->processTemplate(
+                       $ret = $this->templateParser->processTemplate(
                                'SpecialContributionsLine',
                                $templateParams
                        );