Bsitu has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71854
Change subject: Remove Echo preference change eventlogging
......................................................................
Remove Echo preference change eventlogging
Echo preference change is already captured in the general
preference change eventlogging, this is just a duplicate
Change-Id: I49cd2ad5776a670e2cd28414e156f5201087ded0
---
M Echo.php
M Hooks.php
M includes/EventLogging.php
3 files changed, 0 insertions(+), 60 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/54/71854/1
diff --git a/Echo.php b/Echo.php
index 59cc268..12afd65 100755
--- a/Echo.php
+++ b/Echo.php
@@ -552,10 +552,6 @@
'enabled' => false,
'revision' => 5467650
),
- 'EchoPrefUpdate' => array (
- 'enabled' => false,
- 'revision' => 5488876
- ),
'EchoInteraction' => array (
'enabled' => false,
'revision' => 5539940
diff --git a/Hooks.php b/Hooks.php
index 8ebf8b6..0c66d5c 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -833,36 +833,6 @@
* @return bool true in all cases
*/
public static function onUserSaveOptions( $user, &$options ) {
- global $wgOut;
-
- $context = $wgOut->getContext();
-
- // Capture user options saved via Special:Preferences or
ApiOptions
- if ( ( $context->getTitle() && $context->getTitle()->isSpecial(
'Preferences' ) )
- || ( defined( 'MW_API' ) &&
$context->getRequest()->getVal( 'action' ) === 'options' )
- ) {
- // $clone is the current user object with the new
option value not set
- $clone = User::newFromId( $user->getId() );
- $updated = array();
-
- // loop through each options that starts with 'echo-'
- foreach ( $options as $optName => $optValue ) {
- // Only capture echo related preference
- if ( substr( $optName, 0, 5 ) !== 'echo-' ) {
- continue;
- }
- // loose comparision is required since some of
the values
- // are not consistent in the two variables, eg,
'' vs false
- if ( $clone->getOption( $optName ) != $optValue
) {
- $updated[$optName] = $optValue;
- }
- }
-
- if ( $updated ) {
- MWEchoEventLogging::logSchemaEchoPrefUpdate(
$user, $updated );
- }
- }
-
// echo-subscriptions-email-edit-user-talk is just a virtual
option,
// save the value in the real option enotifusertalkpages
if ( isset( $options['echo-subscriptions-email-edit-user-talk']
) ) {
diff --git a/includes/EventLogging.php b/includes/EventLogging.php
index 41eb110..88bb159 100644
--- a/includes/EventLogging.php
+++ b/includes/EventLogging.php
@@ -92,30 +92,4 @@
self::actuallyLogTheEvent( 'EchoMail', $data );
}
- /**
- * Function for logging the event for Schema:EchoPrefUpdate
- * @param $user User user who updates the preference page
- * @param $prefUpdate array list of user preferences being updated
- */
- public static function logSchemaEchoPrefUpdate( User $user, array
$prefUpdate ) {
- global $wgEchoConfig;
-
- if (
!$wgEchoConfig['eventlogging']['EchoPrefUpdate']['enabled'] ) {
- // Only attempt event logging if EchoPrefUpdate schema
is enabled
- return;
- }
-
- $data = array (
- 'version' => $wgEchoConfig['version'],
- 'userId' => $user->getId(),
- 'saveTimestamp' => wfTimestampNow()
- );
- foreach ( $prefUpdate as $prefName => $prefValue ) {
- $data['property'] = $prefName;
- $data['value'] = (string)$prefValue;
- $data['isDefault'] = User::getDefaultOption( $prefName
) == $prefValue;
- self::actuallyLogTheEvent( 'EchoPrefUpdate', $data );
- }
- }
-
}
--
To view, visit https://gerrit.wikimedia.org/r/71854
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I49cd2ad5776a670e2cd28414e156f5201087ded0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits