r95619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95618‎ | r95619 | r95620 >
Date:12:51, 28 August 2011
Author:catrope
Status:ok
Tags:
Comment:
ClickTracking:
* Fix misnested transactions (BEGIN inside the loop, COMMIT outside the loop)
* Fix indentation
* Add FIXME about $.trackAction() not working reliably when called right before submitting a form
Modified paths:
  • /trunk/extensions/ClickTracking/ClickTracking.hooks.php (modified) (history)
  • /trunk/extensions/ClickTracking/modules/sampleCampaign.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php
@@ -96,16 +96,17 @@
9797 global $wgResourceModules;
9898
9999 $cusResourceTemplate = array(
100 - 'localBasePath' => $localBasePath,
101 - 'remoteExtPath' => $remoteExtPath,
 100+ 'localBasePath' => $localBasePath,
 101+ 'remoteExtPath' => $remoteExtPath,
102102 );
103103 $wgResourceModules["ext.UserBuckets.$name"] = array(
104104 'scripts' => "$name.js",
105105 'dependencies' => 'jquery.clickTracking',
106106 ) + $cusResourceTemplate;
107107 $wgResourceModules['ext.UserBuckets']['dependencies'] = array_merge(
108 - ( array ) $wgResourceModules['ext.UserBuckets']['dependencies'],
109 - array("ext.UserBuckets.$name"));
 108+ ( array ) $wgResourceModules['ext.UserBuckets']['dependencies'],
 109+ array( "ext.UserBuckets.$name" )
 110+ );
110111 }
111112
112113 /**
@@ -225,9 +226,9 @@
226227 $db_status_buckets = $db_status_buckets && $db_current_bucket_insert;
227228 }
228229 }//ifbuckets
 230+ $dbw->commit();
229231 }//ifrecord
230232
231 - $dbw->commit();
232233 $retval = $db_status && $db_status_buckets;
233234 }
234235 if ( $wgClickTrackingLog ) {
Index: trunk/extensions/ClickTracking/modules/sampleCampaign.js
@@ -44,6 +44,7 @@
4545 // "allActive" is reserved.
4646 // If this function exists, it will be apply to every user not in the "none" bucket
4747 allActive: function(){
 48+ // FIXME: Calling trackAction() from a click handler of a button that submits a form DOES NOT WORK cross-browser
4849 // Add click tracking to save
4950 jQuery( '#wpSave' ).click(function(){ jQuery.trackAction( 'save' ); });
5051 // Add click tracking to preview

Status & tagging log