Index: trunk/extensions/ContributionTracking/ContributionTracking.php |
— | — | @@ -23,7 +23,8 @@ |
24 | 24 | $wgExtensionAliasesFiles['ContributionTracking'] = $dir . 'ContributionTracking.alias.php'; |
25 | 25 | $wgAutoloadClasses['ContributionTracking'] = $dir . 'ContributionTracking_body.php'; |
26 | 26 | $wgSpecialPages['ContributionTracking'] = 'ContributionTracking'; |
27 | | -$wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates'; |
| 27 | +//this only works if contribution tracking is inside a mediawiki DB, which typically it isn't. |
| 28 | +//$wgHooks['LoadExtensionSchemaUpdates'][] = 'efContributionTrackingLoadUpdates'; |
28 | 29 | |
29 | 30 | |
30 | 31 | $wgContributionTrackingDBserver = $wgDBserver; |
— | — | @@ -49,7 +50,7 @@ |
50 | 51 | //convert a referrer URL to an index in the owa_ref table |
51 | 52 | function ef_contribution_tracking_owa_get_ref_id($ref){ |
52 | 53 | // Replication lag means sometimes a new event will not exist in the table yet |
53 | | - $dbw = wfGetDB( DB_MASTER ); |
| 54 | + $dbw = contributionTrackingConnection(); |
54 | 55 | $id_num = $dbw->selectField( |
55 | 56 | 'contribution_tracking_owa_ref', |
56 | 57 | 'id', |
— | — | @@ -60,7 +61,7 @@ |
61 | 62 | if ( $id_num === false ) { |
62 | 63 | $dbw->insert( |
63 | 64 | 'contribution_tracking_owa_ref', |
64 | | - array( 'url' => (string) $event_name ), |
| 65 | + array( 'url' => (string) $ref ), |
65 | 66 | __METHOD__ |
66 | 67 | ); |
67 | 68 | $id_num = $dbw->insertId(); |