Merge "Make EventLogging code more robust"

This commit is contained in:
jenkins-bot 2023-07-31 11:51:52 +00:00 committed by Gerrit Code Review
commit bfb1f37624

View file

@ -121,6 +121,10 @@ class Hooks implements
* @return void
*/
public function doEventLogging( $action, $article, $data = [] ) {
if ( defined( 'MW_PHPUNIT_TEST' ) ) {
return;
}
$extensionRegistry = ExtensionRegistry::getInstance();
if ( !$extensionRegistry->isLoaded( 'EventLogging' ) || !$extensionRegistry->isLoaded( 'WikimediaEvents' ) ) {
return;
@ -157,7 +161,7 @@ class Hooks implements
'user_is_temp' => $user->isTemp(),
'user_editcount' => $this->userEditTracker->getUserEditCount( $user ) ?: 0,
'mw_version' => MW_VERSION,
'skin' => $skin->getSkinName(),
'skin' => $skin ? $skin->getSkinName() : null,
'is_bot' => $user->isRegistered() && $user->isBot(),
'is_anon' => $user->isAnon(),
'wiki' => WikiMap::getCurrentWikiId(),