WMDE-leszek has uploaded a new change for review.
https://gerrit.wikimedia.org/r/305005
Change subject: Check if logging is enabled before logging Special:Notifcations
page visit
......................................................................
Check if logging is enabled before logging Special:Notifcations page visit
Adds a check before logging a visit added in
Icfe63fb8daa8e8fba029e22b4de3e4f65517c448
Bug: T143092
Change-Id: I9e58ba35eef6a25a78e96a76facc04819cef37da
---
M includes/special/SpecialNotifications.php
1 file changed, 16 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/05/305005/1
diff --git a/includes/special/SpecialNotifications.php
b/includes/special/SpecialNotifications.php
index 962d061..039b5c8 100644
--- a/includes/special/SpecialNotifications.php
+++ b/includes/special/SpecialNotifications.php
@@ -12,6 +12,7 @@
}
public function execute( $par ) {
+ global $wgEchoConfig;
$this->setHeaders();
@@ -160,18 +161,21 @@
$out->addModuleStyles( array( 'ext.echo.styles.notifications',
'ext.echo.styles.special' ) );
// Log visit
- MWEchoEventLogging::actuallyLogTheEvent(
- 'EchoInteraction',
- array(
- 'context' => 'archive',
- 'action' => 'special-page-visit',
- 'userId' => (int)$user->getId(),
- 'editCount' => (int)$user->getEditCount(),
- 'notifWiki' => wfWikiID(),
- // Hack: Figure out if we are in the mobile skin
- 'mobile' => $out->getSkin()->getSkinName() ===
'minerva',
- )
- );
+ if (
$wgEchoConfig['eventlogging']['EchoInteraction']['enabled'] ) {
+ MWEchoEventLogging::actuallyLogTheEvent(
+ 'EchoInteraction',
+ array(
+ 'context' => 'archive',
+ 'action' => 'special-page-visit',
+ 'userId' => (int)$user->getId(),
+ 'editCount' =>
(int)$user->getEditCount(),
+ 'notifWiki' => wfWikiID(),
+ // Hack: Figure out if we are in the
mobile skin
+ 'mobile' =>
$out->getSkin()->getSkinName() === 'minerva',
+ )
+ );
+ }
+
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/305005
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e58ba35eef6a25a78e96a76facc04819cef37da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits