Hooks: Use $revId of -1 for ::logEvent() calls

EventLogging::logEvent() overwrides the $revId parameter when the schema
has been migrated to the Event Platform. Add a note and use a $revId of
-1 to make this consistent with other calls to EventLogging::logEvent()
for schemas that have been migrated to the Event Platform [0].

[0] https://codesearch.wmcloud.org/search/?q=%3A%3AlogEvent%5C(%20%27%5Cw%2B%27%2C%20-1

Bug: T318263
Change-Id: I5b58161a81ce1f4886f23500ee33ed74397d7107
This commit is contained in:
Sam Smith 2022-09-23 14:00:39 +01:00 committed by Samtar
parent 1a198a7c15
commit 96e5f4e6f3

View file

@ -162,7 +162,10 @@ class Hooks implements
$data['user_class'] = 'IP'; $data['user_class'] = 'IP';
} }
return EventLogging::logEvent( 'EditAttemptStep', 18530416, $data ); // NOTE: The 'EditAttemptStep' event was migrated to the Event Platform and is no longer
// using the legacy EventLogging schema from metawiki. $revId is actually overriden by
// the EventLoggingSchemas extension attribute in WikimediaEvents/extension.json.
return EventLogging::logEvent( 'EditAttemptStep', -1, $data );
} }
/** /**
@ -209,7 +212,11 @@ class Hooks implements
$data['bucket'] = $bucket; $data['bucket'] = $bucket;
} }
return EventLogging::logEvent( 'VisualEditorFeatureUse', 21199762, $data ); // NOTE: The 'VisualEditorFeatureUse' event was migrated to the Event Platform and is no
// longer using the legacy EventLogging schema from metawiki. $revId is actually
// overridden by the EventLoggingSchemas extension attribute in
// WikimediaEvents/extension.json.
return EventLogging::logEvent( 'VisualEditorFeatureUse', -1, $data );
} }
/** /**