From: Elliott Eggleston Date: Tue, 27 Aug 2019 03:42:07 +0000 (-0500) Subject: TablePager: put parent construct call back at end X-Git-Tag: 1.34.0-rc.0~564^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/%24link?a=commitdiff_plain;h=28a221825fbcf02f20ad1b228c2f00b70d6d9a92;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); } /**