jenkins-bot has submitted this change and it was merged.
Change subject: Remove loggingSchema/search.js
......................................................................
Remove loggingSchema/search.js
This is being moved to WikimediaEvents repository in Ie486d5eb9
Bug: T115031
Change-Id: I46d3784514155af27b407d78be567c291042fa86
(cherry picked from commit aaf6372edce473a1da47f94967cb2dbe80def4d6)
---
M CirrusSearch.php
M includes/Hooks.php
D resources/loggingSchema/search.js
3 files changed, 0 insertions(+), 123 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CirrusSearch.php b/CirrusSearch.php
index 2b037d5..11d55dc 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -819,11 +819,8 @@
$wgHooks[ 'ArticleDeleteComplete' ][] =
'CirrusSearch\Hooks::onArticleDeleteComplete';
$wgHooks[ 'ArticleRevisionVisibilitySet' ][] =
'CirrusSearch\Hooks::onRevisionDelete';
$wgHooks[ 'BeforeInitialize' ][] = 'CirrusSearch\Hooks::onBeforeInitialize';
-$wgHooks[ 'BeforePageDisplay' ][] = 'CirrusSearch\Hooks::onBeforePageDisplay';
-$wgHooks[ 'EventLoggingRegisterSchemas' ][] =
'CirrusSearch\Hooks::onEventLoggingRegisterSchemas';
$wgHooks[ 'LinksUpdateComplete' ][] =
'CirrusSearch\Hooks::onLinksUpdateCompleted';
$wgHooks[ 'ResourceLoaderGetConfigVars' ][] =
'CirrusSearch\Hooks::onResourceLoaderGetConfigVars';
-$wgHooks[ 'ResourceLoaderRegisterModules' ][] =
'CirrusSearch\Hooks::onResourceLoaderRegisterModules';
$wgHooks[ 'SoftwareInfo' ][] = 'CirrusSearch\Hooks::onSoftwareInfo';
$wgHooks[ 'SpecialSearchResultsPrepend' ][] =
'CirrusSearch\Hooks::onSpecialSearchResultsPrepend';
$wgHooks[ 'SpecialSearchResultsAppend' ][] =
'CirrusSearch\Hooks::onSpecialSearchResultsAppend';
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 7017d8e..e1fa486 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -638,57 +638,6 @@
/**
- * EventLoggingRegisterSchemas hook handler.
- *
- * Registers our EventLogging schemas so that they can be converted to
- * ResourceLoaderSchemaModules by the EventLogging extension.
- *
- * If the module has already been registered in
- * onResourceLoaderRegisterModules, then it is overwritten.
- *
- * @param array $schemas The schemas currently registered with the
EventLogging
- * extension
- * @return bool Always true
- */
- public static function onEventLoggingRegisterSchemas( &$schemas ) {
- // @see https://meta.wikimedia.org/wiki/Schema:Search
- $schemas['Search'] = 12057910;
-
- return true;
- }
-
- /**
- * ResourceLoaderRegisterModules hook handler
- *
- * Registers the ext.cirrusSearch.loggingSchema module without a
dependency on the
- * ext.EventLogging module so that calls to the various log functions
are
- * effectively NOPs.
- *
- * @see
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules
- *
- * @param ResourceLoader &$resourceLoader
- * @return bool Always true
- */
- public static function onResourceLoaderRegisterModules( ResourceLoader
&$resourceLoader ) {
- global $wgResourceModules;
-
- if ( isset( $wgResourceModules['ext.eventLogging'] ) ) {
- $wgResourceModules['ext.cirrusSearch.loggingSchema'] =
array(
- 'localBasePath' => dirname( __DIR__ ),
- 'remoteExtPath' => 'CirrusSearch',
- 'scripts' =>
'resources/loggingSchema/search.js',
- 'dependencies' => array(
- 'jquery.cookie',
- 'json',
- 'mediawiki.user',
- 'schema.Search',
- ),
- );
- }
- return true;
- }
-
- /**
* ResourceLoaderGetConfigVars hook handler
* This should be used for variables which vary with the html
* and for variables this should work cross skin
@@ -704,23 +653,6 @@
'wgCirrusSearchEnableSearchLogging' =>
$wgCirrusSearchEnableSearchLogging,
'wgCirrusSearchFeedbackLink' =>
$wgCirrusSearchFeedbackLink,
);
-
- return true;
- }
-
- /**
- * Load 'ext.cirrusSearch.loggingSchema' if
$wgCirrusSearchEnableSearchLogging is True
- *
- * @param $out
- * @param $skin
- * @return bool
- */
- public static function onBeforePageDisplay( OutputPage &$out, Skin
&$skin ) {
- global $wgCirrusSearchEnableSearchLogging;
-
- if ( $wgCirrusSearchEnableSearchLogging ) {
- $out->addModules( 'ext.cirrusSearch.loggingSchema' );
- }
return true;
}
diff --git a/resources/loggingSchema/search.js
b/resources/loggingSchema/search.js
deleted file mode 100644
index 6062562..0000000
--- a/resources/loggingSchema/search.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*global mw:true */
-( function ( $ ) {
- 'use strict';
-
- var isLoggingEnabled = mw.config.get(
'wgCirrusSearchEnableSearchLogging' ),
- // For 1 in a 1000 users the metadata about interaction
- // with the search form (absent search terms) is event logged.
- // See https://meta.wikimedia.org/wiki/Schema:Search
- isSampled = Math.random() < 1 / 1000,
- defaults,
- sessionStartTime;
-
- /**
- * Generate a random token
- * @return {String}
- */
- function getRandomToken() {
- return mw.user.generateRandomSessionId() + ( new Date()
).getTime().toString();
- }
-
- if ( isLoggingEnabled && isSampled ) {
- defaults = {
- platform: 'desktop',
- userSessionToken: getRandomToken(),
- searchSessionToken: getRandomToken()
- };
-
- mw.trackSubscribe( 'mediawiki.searchSuggest', function ( topic,
data ) {
- var loggingData = {
- action: data.action
- };
-
- if ( data.action === 'session-start' ) {
- // update session token if it's a new search
- defaults.searchSessionToken = getRandomToken();
- sessionStartTime = this.timeStamp;
- } else if ( data.action === 'impression-results' ) {
- loggingData.numberOfResults =
data.numberOfResults;
- loggingData.resultSetType = data.resultSetType;
- loggingData.timeToDisplayResults = Math.round(
this.timeStamp - sessionStartTime );
- } else if ( data.action === 'click-result' ) {
- loggingData.clickIndex = data.clickIndex;
- loggingData.numberOfResults =
data.numberOfResults;
- } else if ( data.action === 'submit-form' ) {
- loggingData.numberOfResults =
data.numberOfResults;
- }
- loggingData.timeOffsetSinceStart = Math.round(
this.timeStamp - sessionStartTime ) ;
- $.extend( loggingData, defaults );
- mw.eventLog.logEvent( 'Search', loggingData );
- } );
- }
-}( jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/248891
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I46d3784514155af27b407d78be567c291042fa86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.27.0-wmf.3
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits