From 929e8463fb99b7773f32d9dff3c29cf9a74915cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 6 Apr 2023 21:13:57 +0200 Subject: [PATCH] Remove hacks that avoid duplicate event logging with MobileFrontend This reverts 843efa2f46039fb78ded8157a88935adfc2d22ef, no longer needed after I6028fa4a34916a6cd20161009cf5893492286c2d. Bug: T334263 Depends-On: I6028fa4a34916a6cd20161009cf5893492286c2d Change-Id: Ie4506d46d350fb53d6d0264763c2d55fc142997e --- includes/Hooks.php | 7 ------- modules/ext.wikiEditor.js | 12 ------------ 2 files changed, 19 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 01276b74..2ae9dc85 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -121,13 +121,6 @@ class Hooks implements if ( !$extensionRegistry->isLoaded( 'EventLogging' ) || !$extensionRegistry->isLoaded( 'WikimediaEvents' ) ) { return false; } - if ( $extensionRegistry->isLoaded( 'MobileFrontend' ) ) { - $mobFrontContext = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' ); - if ( $mobFrontContext->shouldDisplayMobileView() ) { - // on a MobileFrontend page the logging should be handled by it - return false; - } - } $inSample = $this->inEventSample( $data['editing_session_id'] ); $shouldOversample = WikimediaEventsHooks::shouldSchemaEditAttemptStepOversample( $article->getContext() ); if ( !$inSample && !$shouldOversample ) { diff --git a/modules/ext.wikiEditor.js b/modules/ext.wikiEditor.js index b6d70c10..ddc2bf02 100644 --- a/modules/ext.wikiEditor.js +++ b/modules/ext.wikiEditor.js @@ -9,12 +9,6 @@ require( './jquery.wikiEditor.js' ); function logEditEvent( data ) { - if ( mw.config.get( 'wgMFMode' ) !== null ) { - // Visiting a ?action=edit URL can, depending on user settings, result - // in the MobileFrontend overlay appearing on top of WikiEditor. In - // these cases, don't log anything. - return; - } mw.track( 'editAttemptStep', $.extend( { // eslint-disable-next-line camelcase editor_interface: 'wikitext', @@ -24,12 +18,6 @@ } function logEditFeature( feature, action ) { - if ( mw.config.get( 'wgMFMode' ) !== null ) { - // Visiting a ?action=edit URL can, depending on user settings, result - // in the MobileFrontend overlay appearing on top of WikiEditor. In - // these cases, don't log anything. - return; - } mw.track( 'visualEditorFeatureUse', { feature: feature, action: action,