From dfb3e0b8c75e3366a9cc3da2104df23743bf020e Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 30 Jul 2019 15:40:55 -0700 Subject: [PATCH] Restore MobileWebMainMenuClickTracking logging (old way) menu/schema is never imported so it never executed. Move it into initLogging which seems to the be the logic place for this code to execute Change-Id: Iec85548cf96fcc7ea96977d0aa89f601dbd8599f --- resources/skins.minerva.scripts/initLogging.js | 10 ++++++++-- resources/skins.minerva.scripts/menu/schema.js | 6 ++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/skins.minerva.scripts/initLogging.js b/resources/skins.minerva.scripts/initLogging.js index 91c93ca99..1659c5f4d 100644 --- a/resources/skins.minerva.scripts/initLogging.js +++ b/resources/skins.minerva.scripts/initLogging.js @@ -1,8 +1,14 @@ // This initialises EventLogging for main menu and some prominent links in the UI. // This code should only be loaded on the Minerva skin, it does not apply to other skins. // @deprecated and to be removed the moment that T220016 is live. -var mainMenu = require( './menu.js' ); +var mainMenu = require( './menu.js' ), + logging = require( './menu/schema.js' ); module.exports = function () { - mainMenu.enableLogging(); + mw.loader.using( [ + 'ext.eventLogging' + ] ).then( function () { + logging(); + mainMenu.enableLogging(); + } ); }; diff --git a/resources/skins.minerva.scripts/menu/schema.js b/resources/skins.minerva.scripts/menu/schema.js index ff5e1e9b4..035528370 100644 --- a/resources/skins.minerva.scripts/menu/schema.js +++ b/resources/skins.minerva.scripts/menu/schema.js @@ -1,6 +1,4 @@ -mw.loader.using( [ - 'ext.eventLogging' -] ).then( function () { +module.exports = function () { var M = mw.mobileFrontend, user = mw.user, editCount = mw.config.get( 'wgUserEditCount' ), @@ -50,4 +48,4 @@ mw.loader.using( [ mw.trackSubscribe( 'minerva.schemaMobileWebMainMenuClickTracking', function ( topic, data ) { schemaMobileWebMainMenuClickTracking.log( data ); } ); -} ); +};