Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -209,12 +209,9 @@ |
210 | 210 | $db_status = $dbw->insert( 'click_tracking', $data, __METHOD__ ); |
211 | 211 | $dbw->commit(); |
212 | 212 | |
213 | | - |
214 | | - |
215 | | - |
216 | 213 | if( $recordBucketInfo && $db_status ){ |
217 | 214 | $buckets = self::unpackBucketInfo(); |
218 | | - |
| 215 | + $dbw->ignoreErrors( true ); // if inserting on duplicate key, it's ok |
219 | 216 | if( $buckets ){ |
220 | 217 | foreach( $buckets as $bucketName => $bucketValue ){ |
221 | 218 | $db_current_bucket_insert = $dbw->insert( 'click_tracking_user_properties', |
— | — | @@ -228,9 +225,9 @@ |
229 | 226 | $db_status_buckets = $db_status_buckets && $db_current_bucket_insert; |
230 | 227 | } |
231 | 228 | }//ifbuckets |
| 229 | + $dbw->ignoreErrors( false ); |
232 | 230 | }//ifrecord |
233 | 231 | |
234 | | - |
235 | 232 | $dbw->commit(); |
236 | 233 | return ($db_status && $db_status_buckets); |
237 | 234 | |
Index: trunk/extensions/ClickTracking/patches/ClickTrackingUserProperties.sql |
— | — | @@ -14,10 +14,10 @@ |
15 | 15 | property_value varbinary(255), |
16 | 16 | |
17 | 17 | -- property version |
18 | | - property_version INTEGER, |
| 18 | + property_version INTEGER |
19 | 19 | |
20 | | - UNIQUE KEY id_name_value_version (session_id, property_name, property_value, property_version) |
21 | | - |
22 | 20 | ) /*$wgDBTableOptions*/; |
23 | 21 | |
24 | | -CREATE INDEX /*i*/click_tracking_user_properties_session_idx ON /*_*/click_tracking_user_properties (session_id); |
\ No newline at end of file |
| 22 | +CREATE INDEX /*i*/click_tracking_user_properties_session_idx ON /*_*/click_tracking_user_properties (session_id); |
| 23 | + |
| 24 | +CREATE UNIQUE INDEX ct_user_prop_id_name_value_version ON /*_*/click_tracking_user_properties(session_id, property_name, property_value, property_version); |
\ No newline at end of file |
Index: trunk/extensions/ClickTracking/modules/ext.UserBuckets.js |
— | — | @@ -40,9 +40,7 @@ |
41 | 41 | |
42 | 42 | $.setBucket = function ( bucketName, bucketValue, bucketVersion ){ |
43 | 43 | var bucketCookies = $.getBuckets(); |
44 | | - alert("HELLOA"); |
45 | 44 | if(!bucketCookies) { bucketCookies ={};} |
46 | | - alert("HELLOB"); |
47 | 45 | bucketCookies[ bucketName ] = [ bucketValue, bucketVersion ]; |
48 | 46 | $j.cookie('userbuckets', JSON.stringify( bucketCookies ) , { expires: 365 }); //expires in 1 year |
49 | 47 | bucketCookies = $.getBuckets(true); //force it to rerun and update |