Ori.livneh has uploaded a new change for review.

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


Change subject: Update to new schema revision; pre-load schema module
......................................................................

Update to new schema revision; pre-load schema module

Changes:
- Avoid logging country / city if values are present but empty.
- Ensure 'schema.HttpsSupport' is loaded before ext.coreEvents.httpsSupport.
- Bump schema revision to 5733378.

Change-Id: I362c5975b1075f22b666b9b67c0a8c1434b5372c
---
M CoreEvents.php
M modules/ext.coreEvents.httpsSupport.js
2 files changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CoreEvents 
refs/changes/54/80154/1

diff --git a/CoreEvents.php b/CoreEvents.php
index 8ff81b0..d722783 100644
--- a/CoreEvents.php
+++ b/CoreEvents.php
@@ -41,7 +41,7 @@
        'schema.HttpsSupport' => array(
                'class'         => 'ResourceLoaderSchemaModule',
                'schema'        => 'HttpsSupport',
-               'revision'      => 5731023,
+               'revision'      => 5733378,
                'targets'       => array( 'desktop', 'mobile' ),
                'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
        ),
@@ -49,6 +49,7 @@
                'scripts'       => 'ext.coreEvents.httpsSupport.js',
                'localBasePath' => __DIR__ . '/modules',
                'remoteExtPath' => 'CoreEvents/modules',
+               'dependencies'  => 'schema.HttpsSupport',
                'targets'       => array( 'desktop', 'mobile' ),
                'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
        ),
@@ -57,7 +58,7 @@
 // Hooks
 
 $wgHooks[ 'BeforePageDisplay' ][] = function ( &$out, &$skin ) {
-       $out->addModules( 'ext.coreEvents.httpsSupport' );
+       $out->addModules( array( 'schema.HttpsSupport', 
'ext.coreEvents.httpsSupport' ) );
        return true;
 };
 
diff --git a/modules/ext.coreEvents.httpsSupport.js 
b/modules/ext.coreEvents.httpsSupport.js
index a4f6dae..dff4402 100644
--- a/modules/ext.coreEvents.httpsSupport.js
+++ b/modules/ext.coreEvents.httpsSupport.js
@@ -56,8 +56,12 @@
                                        event.mobileMode = mw.config.get( 
'wgMFMode' );
                                }
                                if ( $.isPlainObject( window.Geo ) ) {
-                                       event.originCountry = Geo.country;
-                                       event.originCity = Geo.city;
+                                       if ( typeof Geo.country === 'string' && 
Geo.country.length ) {
+                                               event.originCountry = 
Geo.country;
+                                       }
+                                       if ( typeof Geo.city === 'string' && 
Geo.city.length ) {
+                                               event.originCity = Geo.city;
+                                       }
                                }
                                mw.eventLog.logEvent( 'HttpsSupport', event );
                        } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I362c5975b1075f22b666b9b67c0a8c1434b5372c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CoreEvents
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

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

Reply via email to