jenkins-bot has submitted this change and it was merged.

Change subject: Set context earlier in ImageListPager::__construct
......................................................................


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
---
M includes/specials/SpecialListfiles.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialListfiles.php 
b/includes/specials/SpecialListfiles.php
index d4b45fb..7576c1f 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -84,6 +84,7 @@
        function __construct( IContextSource $context, $userName = null, 
$search = '',
                $including = false, $showAll = false
        ) {
+               $this->setContext( $context );
                $this->mIncluding = $including;
                $this->mShowAll = $showAll;
 
@@ -107,7 +108,7 @@
                }
 
                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;

-- 
To view, visit https://gerrit.wikimedia.org/r/197935
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf3faefe8c20c017a479f07594809dfb003db9af
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to