From 28a221825fbcf02f20ad1b228c2f00b70d6d9a92 Mon Sep 17 00:00:00 2001 From: Elliott Eggleston Date: Mon, 26 Aug 2019 22:42:07 -0500 Subject: [PATCH] TablePager: put parent construct call back at end Restores position of parent constructor call, changed in commit I082152b64141f1a. The parent constructor calls getIndexField(), which depends on the mSort value already being set. Bug: T231261 Change-Id: If07f10075a51fbbe9de24464cb6844faaad94780 --- includes/pager/TablePager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php index 7f546173aa..36ed9aa66a 100644 --- a/includes/pager/TablePager.php +++ b/includes/pager/TablePager.php @@ -35,8 +35,6 @@ abstract class TablePager extends IndexPager { protected $mCurrentRow; public function __construct( IContextSource $context = null, LinkRenderer $linkRenderer = null ) { - parent::__construct( $context, $linkRenderer ); - $this->mSort = $this->getRequest()->getText( 'sort' ); if ( !array_key_exists( $this->mSort, $this->getFieldNames() ) || !$this->isFieldSortable( $this->mSort ) @@ -48,6 +46,9 @@ abstract class TablePager extends IndexPager { } elseif ( $this->getRequest()->getBool( 'desc' ) ) { $this->mDefaultDirection = IndexPager::DIR_DESCENDING; } /* Else leave it at whatever the class default is */ + + // Parent constructor needs mSort set, so we call it last + parent::__construct( $context, $linkRenderer ); } /** -- 2.20.1