From: umherirrender Date: Thu, 19 Mar 2015 16:28:05 +0000 (+0100) Subject: Set context earlier in ImageListPager::__construct X-Git-Tag: 1.31.0-rc.0~11765^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=952b0a338808b12ed7a2351f998f1e0b2c12996e;p=lhc%2Fweb%2Fwiklou.git Set context earlier in ImageListPager::__construct The parent constructor sets the $context for the Page, but the getConfig is before the call, which results in a warning for using RequestContext::getMain(). Just set the context before use. Change-Id: Icf3faefe8c20c017a479f07594809dfb003db9af --- diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index d4b45fb311..7576c1fdb9 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -84,6 +84,7 @@ class ImageListPager extends TablePager { function __construct( IContextSource $context, $userName = null, $search = '', $including = false, $showAll = false ) { + $this->setContext( $context ); $this->mIncluding = $including; $this->mShowAll = $showAll; @@ -107,7 +108,7 @@ class ImageListPager extends TablePager { } if ( !$including ) { - if ( $context->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) { + if ( $this->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) { $this->mDefaultDirection = IndexPager::DIR_DESCENDING; } else { $this->mDefaultDirection = IndexPager::DIR_ASCENDING;