Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/168923

Change subject: Remove RequestContext::getMainAndWarn
......................................................................

Remove RequestContext::getMainAndWarn

It's not RequestContext's responsibility to log that some other
class does not have a context available.

Can be removed as there aren't any users out there.
Will backport this to the yet unreleased 1.24.

This was introduced in I1628a179.

Change-Id: I23b2adf0e25f6c95b2028607f044df2fb0cc40e9
---
M includes/context/RequestContext.php
M includes/gallery/ImageGalleryBase.php
2 files changed, 6 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/168923/1

diff --git a/includes/context/RequestContext.php 
b/includes/context/RequestContext.php
index 059f18c..1f63598 100644
--- a/includes/context/RequestContext.php
+++ b/includes/context/RequestContext.php
@@ -433,21 +433,6 @@
        }
 
        /**
-        * Get the RequestContext object associated with the main request
-        * and gives a warning to the log, to find places, where a context 
maybe is missing.
-        *
-        * @param string $func
-        * @return RequestContext
-        * @since 1.24
-        */
-       public static function getMainAndWarn( $func = __METHOD__ ) {
-               wfDebug( $func . ' called without context. ' .
-                       "Using RequestContext::getMain() for sanity\n" );
-
-               return self::getMain();
-       }
-
-       /**
         * Resets singleton returned by getMain(). Should be called only from 
unit tests.
         */
        public static function resetMain() {
diff --git a/includes/gallery/ImageGalleryBase.php 
b/includes/gallery/ImageGalleryBase.php
index b0a593d..d356a2f 100644
--- a/includes/gallery/ImageGalleryBase.php
+++ b/includes/gallery/ImageGalleryBase.php
@@ -93,9 +93,14 @@
        static function factory( $mode = false, IContextSource $context = null 
) {
                global $wgContLang;
                self::loadModes();
+
                if ( !$context ) {
-                       $context = RequestContext::getMainAndWarn( __METHOD__ );
+                       wfDebug( __METHOD__ . ' called without context. ' .
+                       "Using RequestContext::getMain() for sanity\n" );
+
+                       $context = RequestContext::getMain();
                }
+
                if ( !$mode ) {
                        $galleryOpions = $context->getConfig()->get( 
'GalleryOptions' );
                        $mode = $galleryOpions['mode'];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I23b2adf0e25f6c95b2028607f044df2fb0cc40e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>

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

Reply via email to