Yurik has uploaded a new change for review.

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


Change subject: TEMPORARY: Log lots of info to catch a bug
......................................................................

TEMPORARY: Log lots of info to catch a bug

Change-Id: Ie5537a4fc0c79ce49baf386e4dcb61d2b7b25a3b
---
M includes/PageRenderingHooks.php
1 file changed, 21 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess 
refs/changes/20/64020/1

diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index c2aef24..1b8076a 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -21,7 +21,7 @@
 class PageRenderingHooks {
        private static $formatMobileUrl = '//%s.m.wikipedia.org/wiki/Main_Page';
        private static $formatZeroUrl = 
'//%s.zero.wikipedia.org/wiki/Main_Page';
-
+       private static $carrierId;
 
        /**
         * GetMobileUrl hook handler
@@ -368,6 +368,25 @@
                        global $wgLang;
                        $lang = $wgLang;
                }
+
+
+
+               // BUG HUNTING!
+               if ( !$config['name'] || !$config['banner'] ) {
+                       global $wgRequest;
+                       $dbg = 'Zero bug, ID="' . self::$carrierId . '"- 
missing';
+                       if ( !$config['name'] ) $dbg .= ' name';
+                       if ( !$config['banner'] ) $dbg .= ' banner';
+                       $dbg .= ': ';
+                       $dbg .= print_r( $config, true );
+                       $dbg .= "\nURL: " . $_SERVER["SERVER_NAME"] . 
$_SERVER["REQUEST_URI"];
+                       $dbg .= "\nHeaders: " . print_r( 
$wgRequest->getAllHeaders(), true );
+                       wfDebugLog( 'mobile', $dbg );
+               }
+
+
+
+
                $fallbacks = null;
                $name = self::pickLocalizedString( $config['name'], $lang, 
$fallbacks );
                if ( $name === false ) {
@@ -440,6 +459,7 @@
                if ( $id === '(null)' || !$id ) {
                        $id = null;
                }
+               self::$carrierId = $id;
                if ( $id !== null ) {
                        $store = new CarrierConfigStore( $id );
                        $text = $store->get();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5537a4fc0c79ce49baf386e4dcb61d2b7b25a3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to