r107797 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107796‎ | r107797 | r107798 >
Date:04:34, 2 January 2012
Author:johnduhart
Status:resolved
Tags:aft 
Comment:
More context source
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -323,7 +323,7 @@
324324 * @return bool
325325 */
326326 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
328328 return true;
329329 }
330330
@@ -347,7 +347,7 @@
348348 public static function trackEditSuccess( &$article, &$user, $text,
349349 $summary, $minoredit, $watchthis, $sectionanchor, &$flags,
350350 $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() );
352352 return true;
353353 }
354354
@@ -355,23 +355,26 @@
356356 * Internal use: Tracks an event
357357 *
358358 * @param $event string the event name
359 - * @param $title Title
 359+ * @param $context IContextSource
360360 * @return
361361 */
362 - private static function trackEvent( $event, $title ) {
363 - global $wgRequest, $wgArticleFeedbackv5Tracking;
 362+ private static function trackEvent( $event, $title, IContextSource $context ) {
 363+ global $wgArticleFeedbackv5Tracking;
364364 $ctas = array( 'none', 'edit', 'learn_more' );
365365
366 - $tracking = $wgRequest->getVal( 'articleFeedbackv5_click_tracking' );
 366+ $request = $context->getRequest();
 367+ $title = $context->getTitle();
 368+
 369+ $tracking = $request->getVal( 'articleFeedbackv5_click_tracking' );
367370 if ( !$tracking ) {
368371 return;
369372 }
370373
371374 $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' );
376379
377380 $trackingId = 'ext.articleFeedbackv5@' . $version
378381 . '-option' . $bucketId

Follow-up revisions

RevisionCommit summaryAuthorDate
r107799Followup r107797, too much context sourcejohnduhart05:25, 2 January 2012

Status & tagging log