From 952b0a338808b12ed7a2351f998f1e0b2c12996e Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 19 Mar 2015 17:28:05 +0100 Subject: [PATCH] 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 --- includes/specials/SpecialListfiles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.20.1