From d7993a35b8efb5bfdae7cdc6c447025319e0aa4e Mon Sep 17 00:00:00 2001 From: ksarabia Date: Thu, 20 Jul 2023 16:16:52 -0500 Subject: [PATCH] Update reference in WikiEditor Logs data from WikiEditor Bug: T337270 Change-Id: I69b4ea31397915ce1e90cff91e44b3648d57f389 --- includes/Hooks.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 9ff0cc99..20877f1d 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -31,6 +31,7 @@ use MediaWiki\Preferences\Hook\GetPreferencesHook; use MediaWiki\ResourceLoader as RL; use MediaWiki\User\UserEditTracker; use MediaWiki\User\UserOptionsLookup; +use MediaWiki\WikiMap\WikiMap; use MessageLocalizer; use MWCryptRand; use OutputPage; @@ -138,6 +139,7 @@ class Hooks implements $page = $article->getPage(); $title = $article->getTitle(); $revisionRecord = $page->getRevisionRecord(); + $skin = $article->getContext()->getSkin(); $data = [ 'action' => $action, @@ -155,6 +157,10 @@ class Hooks implements 'user_is_temp' => $user->isTemp(), 'user_editcount' => $this->userEditTracker->getUserEditCount( $user ) ?: 0, 'mw_version' => MW_VERSION, + 'skin' => $skin->getSkinName(), + 'is_bot' => $user->isRegistered() && $user->isBot(), + 'is_anon' => $user->isAnon(), + 'wiki' => WikiMap::getCurrentWikiId(), ] + $data; $bucket = ExtensionRegistry::getInstance()->isLoaded( 'DiscussionTools' ) ? @@ -177,7 +183,7 @@ class Hooks implements EventLogging::submit( 'eventlogging_EditAttemptStep', [ - '$schema' => '/analytics/legacy/editattemptstep/1.4.1', + '$schema' => '/analytics/legacy/editattemptstep/2.0.0', 'event' => $data, ] );