diff --git a/includes/Hooks.php b/includes/Hooks.php index 05e21234..77780671 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -145,8 +145,8 @@ class Hooks implements 'mw_version' => MW_VERSION, ] + $data; - if ( $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' ) ) { - $data['bucket'] = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' ); + if ( $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' ) ) { + $data['bucket'] = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' ); } if ( $user->isAnon() ) { @@ -193,7 +193,7 @@ class Hooks implements 'user_editcount' => $editCount ?: 0, ]; - $bucket = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest' ); + $bucket = $this->userOptionsLookup->getOption( $user, 'discussiontools-abtest2' ); if ( $bucket ) { $data['bucket'] = $bucket; } diff --git a/modules/ext.wikiEditor.js b/modules/ext.wikiEditor.js index 4adb962d..824d00d6 100644 --- a/modules/ext.wikiEditor.js +++ b/modules/ext.wikiEditor.js @@ -83,8 +83,11 @@ data.user_class = 'IP'; } - if ( mw.user.options.get( 'discussiontools-abtest' ) ) { - data.bucket = mw.user.options.get( 'discussiontools-abtest' ); + if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) { + data.bucket = mw.config.get( 'wgDiscussionToolsABTestBucket' ); + if ( mw.config.get( 'wgDiscussionToolsAnonymousUserId' ) ) { + data.anonymous_user_id = mw.config.get( 'wgDiscussionToolsAnonymousUserId' ); + } } // Schema's kind of a mess of special properties @@ -119,10 +122,13 @@ integration: 'page', editor_interface: 'wikitext' }; - /* eslint-enable camelcase */ - if ( mw.user.options.get( 'discussiontools-abtest' ) ) { - data.bucket = mw.user.options.get( 'discussiontools-abtest' ); + if ( mw.config.get( 'wgDiscussionToolsABTestBucket' ) ) { + data.bucket = mw.config.get( 'wgDiscussionToolsABTestBucket' ); + if ( mw.config.get( 'wgDiscussionToolsAnonymousUserId' ) ) { + data.anonymous_user_id = mw.config.get( 'wgDiscussionToolsAnonymousUserId' ); + } } + /* eslint-enable camelcase */ return data; } );