mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-11-15 03:35:58 +00:00
Avoid User::getEditCount() and ::getOption()
The latter is deprecated, and the former is just a wrapper for UserEditTracker::getUserEditCount(). Bug: T290521 Change-Id: Id3f2b9a007fe299d74d5957cbd3e31b11adb2790
This commit is contained in:
parent
d5175e8695
commit
d23389cd06
|
@ -111,7 +111,8 @@ class WikiEditorHooks {
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $article->getContext()->getUser();
|
$user = $article->getContext()->getUser();
|
||||||
|
$services = MediaWikiServices::getInstance();
|
||||||
|
$editCount = $services->getUserEditTracker()->getUserEditCount( $user );
|
||||||
$data = [
|
$data = [
|
||||||
'feature' => $feature,
|
'feature' => $feature,
|
||||||
'action' => $action,
|
'action' => $action,
|
||||||
|
@ -121,11 +122,12 @@ class WikiEditorHooks {
|
||||||
'integration' => 'page',
|
'integration' => 'page',
|
||||||
'editor_interface' => 'wikitext',
|
'editor_interface' => 'wikitext',
|
||||||
'user_id' => $user->getId(),
|
'user_id' => $user->getId(),
|
||||||
'user_editcount' => $user->getEditCount() ?: 0,
|
'user_editcount' => $editCount ?: 0,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( $user->getOption( 'discussiontools-abtest' ) ) {
|
$bucket = $services->getUserOptionsLookup()->getOption( $user, 'discussiontools-abtest' );
|
||||||
$data['bucket'] = $user->getOption( 'discussiontools-abtest' );
|
if ( $bucket ) {
|
||||||
|
$data['bucket'] = $bucket;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EventLogging::logEvent( 'VisualEditorFeatureUse', 21199762, $data );
|
return EventLogging::logEvent( 'VisualEditorFeatureUse', 21199762, $data );
|
||||||
|
|
Loading…
Reference in a new issue