r111007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111006‎ | r111007 | r111008 >
Date:01:16, 9 February 2012
Author:bsitu
Status:resolved (Comments)
Tags:
Comment:
tracking the title for missing article in additional field
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/SpecialArticleCreationLanding.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationUtil.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationUtil.php
@@ -24,8 +24,9 @@
2525 * Track the page stats to the special article creation landing page
2626 * @param $request Object
2727 * @param $user Object
 28+ * @param $par string - the title for the non-existing article
2829 */
29 - public static function TrackSpecialLandingPage( $request, $user ) {
 30+ public static function TrackSpecialLandingPage( $request, $user, $par ) {
3031 if ( $user->isAnon() ) {
3132 $event = 'landingpage-anonymous';
3233 } else {
@@ -38,15 +39,16 @@
3940 }
4041 }
4142
42 - self::clickTracking( $event, SpecialPage::getTitleFor( 'ArticleCreationLanding' ) );
 43+ self::clickTracking( $event, SpecialPage::getTitleFor( 'ArticleCreationLanding' ), $par );
4344 }
4445
4546 /**
4647 * Tracking code that calls ClickTracking
4748 * @param $event string the event name
4849 * @param $title Object
 50+ * @param $info string - additional info for click tracking
4951 */
50 - private static function clickTracking( $event, $title ) {
 52+ private static function clickTracking( $event, $title, $info = '' ) {
5153 // check if ClickTracking API is enabled
5254 if ( !self::trackingEnabled() ) {
5355 return;
@@ -56,7 +58,8 @@
5759 'action' => 'clicktracking',
5860 'eventid' => self::trackingCodePrefix() . $event,
5961 'token' => wfGenerateToken(),
60 - 'namespacenumber' => $title->getNamespace()
 62+ 'namespacenumber' => $title->getNamespace(),
 63+ 'additional' => $info
6164 ) );
6265 $api = new ApiMain( $params, true );
6366 $api->execute();
Index: trunk/extensions/ArticleCreationWorkflow/SpecialArticleCreationLanding.php
@@ -34,7 +34,7 @@
3535 $wgOut->addModules( 'ext.articleCreation.user' );
3636 $wgOut->addHtml( ArticleCreationTemplates::getLandingPage($par) );
3737
38 - ArticleCreationUtil::TrackSpecialLandingPage( $wgRequest, $wgUser );
 38+ ArticleCreationUtil::TrackSpecialLandingPage( $wgRequest, $wgUser, $par );
3939 }
4040
4141 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r111136ArticleCreationWorkflow: Remove the $info parameter to ArticleCreationUtils::...werdna00:51, 10 February 2012

Comments

#Comment by Werdna (talk | contribs)   00:47, 10 February 2012
+			'namespacenumber' => $title->getNamespace(),

I think this is wrong. Don't you want to provide the namespace and title of the page parameter?

#Comment by Werdna (talk | contribs)   00:49, 10 February 2012

Sorry, it's this part that's wrong.

+		self::clickTracking( $event, SpecialPage::getTitleFor( 'ArticleCreationLanding' ), $par );

and passing the title text as the extra info is unnecessary.

I'm fixing it up now.

#Comment by Werdna (talk | contribs)   00:53, 10 February 2012

Resolved in r111136.

#Comment by Bsitu (talk | contribs)   01:01, 10 February 2012

Yes, I was confused by which page we want to keep in the log namespace: the landing page vs the missing title, :)

Status & tagging log