Merge "Restore some previous constructor calls"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 27 Aug 2019 17:04:14 +0000 (17:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 27 Aug 2019 17:04:14 +0000 (17:04 +0000)
includes/pager/TablePager.php
includes/specials/pagers/ImageListPager.php
includes/specials/pagers/UsersPager.php

index 36ed9aa..f611699 100644 (file)
@@ -35,6 +35,10 @@ abstract class TablePager extends IndexPager {
        protected $mCurrentRow;
 
        public function __construct( IContextSource $context = null, LinkRenderer $linkRenderer = null ) {
+               if ( $context ) {
+                       $this->setContext( $context );
+               }
+
                $this->mSort = $this->getRequest()->getText( 'sort' );
                if ( !array_key_exists( $this->mSort, $this->getFieldNames() )
                        || !$this->isFieldSortable( $this->mSort )
@@ -48,7 +52,7 @@ abstract class TablePager extends IndexPager {
                } /* Else leave it at whatever the class default is */
 
                // Parent constructor needs mSort set, so we call it last
-               parent::__construct( $context, $linkRenderer );
+               parent::__construct( null, $linkRenderer );
        }
 
        /**
index 6bdccd8..81b7808 100644 (file)
@@ -53,7 +53,7 @@ class ImageListPager extends TablePager {
        public function __construct( IContextSource $context, $userName = null, $search = '',
                $including = false, $showAll = false
        ) {
-               parent::__construct( $context );
+               $this->setContext( $context );
 
                $this->mIncluding = $including;
                $this->mShowAll = $showAll;
@@ -95,6 +95,8 @@ class ImageListPager extends TablePager {
                } else {
                        $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
                }
+
+               parent::__construct();
        }
 
        /**
index e27fb58..57b575b 100644 (file)
@@ -44,6 +44,10 @@ class UsersPager extends AlphabeticPager {
         * another page
         */
        public function __construct( IContextSource $context = null, $par = null, $including = null ) {
+               if ( $context ) {
+                       $this->setContext( $context );
+               }
+
                $request = $this->getRequest();
                $par = $par ?? '';
                $parms = explode( '/', $par );
@@ -83,7 +87,7 @@ class UsersPager extends AlphabeticPager {
                        }
                }
 
-               parent::__construct( $context );
+               parent::__construct();
        }
 
        /**