Set context earlier in ImageListPager::__construct
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 19 Mar 2015 16:28:05 +0000 (17:28 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 29 Mar 2015 18:45:11 +0000 (20:45 +0200)
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

index d4b45fb..7576c1f 100644 (file)
@@ -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;