mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-23 15:57:15 +00:00
Don't do logging if MobileFrontend is active for the current page
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. Bug: T320281 Change-Id: Ib98d2cd6f2e541423e5aeebd3093bad97d6fcc4f
This commit is contained in:
parent
609e1e066a
commit
843efa2f46
|
@ -122,6 +122,13 @@ class Hooks implements
|
|||
if ( !$extensionRegistry->isLoaded( 'EventLogging' ) ) {
|
||||
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 = $extensionRegistry->isLoaded( 'WikimediaEvents' ) &&
|
||||
WikimediaEventsHooks::shouldSchemaEditAttemptStepOversample( $article->getContext() );
|
||||
|
|
|
@ -21,6 +21,12 @@
|
|||
if ( mw.loader.getState( 'ext.eventLogging' ) === null ) {
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
mw.loader.using( [ 'ext.eventLogging' ] ).done( function () {
|
||||
|
|
Loading…
Reference in a new issue