Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -323,7 +323,7 @@ |
324 | 324 | * @return bool |
325 | 325 | */ |
326 | 326 | public static function trackEditAttempt( $editpage ) { |
327 | | - self::trackEvent( 'edit_attempt', $editpage->getArticle()->getTitle() ); // EditPage::getTitle() doesn't exist in 1.18wmf1 |
| 327 | + self::trackEvent( 'edit_attempt', $editpage->getArticle()->getTitle(), $editpage->getArticle()->getContext() ); // EditPage::getTitle() doesn't exist in 1.18wmf1 |
328 | 328 | return true; |
329 | 329 | } |
330 | 330 | |
— | — | @@ -347,7 +347,7 @@ |
348 | 348 | public static function trackEditSuccess( &$article, &$user, $text, |
349 | 349 | $summary, $minoredit, $watchthis, $sectionanchor, &$flags, |
350 | 350 | $revision, &$status, $baseRevId /*, &$redirect */ ) { // $redirect not passed in 1.18wmf1 |
351 | | - self::trackEvent( 'edit_success', $article->getTitle() ); |
| 351 | + self::trackEvent( 'edit_success', $article->getTitle(), $article->getContext() ); |
352 | 352 | return true; |
353 | 353 | } |
354 | 354 | |
— | — | @@ -355,23 +355,26 @@ |
356 | 356 | * Internal use: Tracks an event |
357 | 357 | * |
358 | 358 | * @param $event string the event name |
359 | | - * @param $title Title |
| 359 | + * @param $context IContextSource |
360 | 360 | * @return |
361 | 361 | */ |
362 | | - private static function trackEvent( $event, $title ) { |
363 | | - global $wgRequest, $wgArticleFeedbackv5Tracking; |
| 362 | + private static function trackEvent( $event, $title, IContextSource $context ) { |
| 363 | + global $wgArticleFeedbackv5Tracking; |
364 | 364 | $ctas = array( 'none', 'edit', 'learn_more' ); |
365 | 365 | |
366 | | - $tracking = $wgRequest->getVal( 'articleFeedbackv5_click_tracking' ); |
| 366 | + $request = $context->getRequest(); |
| 367 | + $title = $context->getTitle(); |
| 368 | + |
| 369 | + $tracking = $request->getVal( 'articleFeedbackv5_click_tracking' ); |
367 | 370 | if ( !$tracking ) { |
368 | 371 | return; |
369 | 372 | } |
370 | 373 | |
371 | 374 | $version = $wgArticleFeedbackv5Tracking['version']; |
372 | | - $bucketId = $wgRequest->getVal( 'articleFeedbackv5_bucket_id' ); |
373 | | - $ctaId = $wgRequest->getVal( 'articleFeedbackv5_cta_id' ); |
374 | | - $location = $wgRequest->getVal( 'articleFeedbackv5_location' ); |
375 | | - $token = $wgRequest->getVal( 'articleFeedbackv5_ct_token' ); |
| 375 | + $bucketId = $request->getVal( 'articleFeedbackv5_bucket_id' ); |
| 376 | + $ctaId = $request->getVal( 'articleFeedbackv5_cta_id' ); |
| 377 | + $location = $request->getVal( 'articleFeedbackv5_location' ); |
| 378 | + $token = $request->getVal( 'articleFeedbackv5_ct_token' ); |
376 | 379 | |
377 | 380 | $trackingId = 'ext.articleFeedbackv5@' . $version |
378 | 381 | . '-option' . $bucketId |