jenkins-bot has submitted this change and it was merged.
Change subject: Remove optional ClickTracking integration
......................................................................
Remove optional ClickTracking integration
MoodBar's e-mail notification feature had an optional dependency on
ClickTracking, which it would use to generate links that logged an
analytic event using ClickTracking's API endpoint before redirecting the
user to their original destination. This patch removes this optional
integration but keeps the behavior consistent with how the extension
behaved if ClickTracking was not detected.
This is one of the last few uses of ClickTracking in our deployment
codebase.
Change-Id: I1a22e7d36e24049ca7ccd249df523ef88000e6b2
---
M include/MoodBarHTMLEmailNotification.php
1 file changed, 8 insertions(+), 38 deletions(-)
Approvals:
Mattflaschen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/include/MoodBarHTMLEmailNotification.php
b/include/MoodBarHTMLEmailNotification.php
index 984a7d7..e3e2da4 100644
--- a/include/MoodBarHTMLEmailNotification.php
+++ b/include/MoodBarHTMLEmailNotification.php
@@ -241,51 +241,21 @@
}
/**
- * Build the link for Email, add clickTracking if available
- * @return array - the links to be tracked in email
+ * Build the link for e-mail
+ * @since 1.21 Remove conditional ClickTracking integration
+ * @return array Array of URLs to include in e-mail
*/
protected function buildEmailLink() {
$pageObject = array(
- 'feedbackPage' => array( 'obj' =>
SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback ),
'clicktracking' => false ),
- 'editorTalkPage' => array( 'obj' =>
$this->editor->getTalkPage(), 'clicktracking' => false ),
- 'targetUserTalkPage' => array( 'obj' =>
$this->targetUser->getTalkPage(), 'clicktracking' => true )
+ 'feedbackPage' => array( 'obj' =>
SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback ) ),
+ 'editorTalkPage' => array( 'obj' =>
$this->editor->getTalkPage() ),
+ 'targetUserTalkPage' => array( 'obj' =>
$this->targetUser->getTalkPage() ),
);
$links = array();
- // if clickTracking is not enabled, return the full canonical
url for email
- if ( !class_exists( 'ApiClickTracking' ) ) {
- foreach ( $pageObject as $key => $value ) {
- $links[$key.'Url'] =
$value['obj']->getCanonicalURL();
- }
- }
- else {
- global $wgMoodBarConfig;
-
- $token = MWCryptRand::generateHex( 32 );
- $eventid = 'ext.feedbackDashboard@' .
$wgMoodBarConfig['bucketConfig']['version'] .
- '-email-response_link-' . $this->type;
-
- $clickTrackingLink = wfAppendQuery(
- wfScript( 'api' ),
- array( 'action' => 'clicktracking', 'eventid'
=> $eventid, 'token' => $token )
- );
-
- foreach ( $pageObject as $key => $value ) {
- if ( $value['clicktracking'] ) {
- $links[$key.'Url'] = wfExpandUrl(
wfAppendQuery(
- $clickTrackingLink,
- array(
- 'redirectto' =>
$value['obj']->getLinkURL(),
-
'namespacenumber' => $value['obj']->getNamespace()
- )
- ),
- PROTO_CANONICAL
- );
- } else {
- $links[$key.'Url'] =
$value['obj']->getCanonicalURL();
- }
- }
+ foreach ( $pageObject as $key => $value ) {
+ $links[$key.'Url'] = $value['obj']->getCanonicalURL();
}
return $links;
--
To view, visit https://gerrit.wikimedia.org/r/55238
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1a22e7d36e24049ca7ccd249df523ef88000e6b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MoodBar
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits