jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/381360 )

Change subject: Don't clobber contribution_tracking in makemissing mode
......................................................................


Don't clobber contribution_tracking in makemissing mode

When the audit processor is supposed to send incomplete data to
Civi, don't stuff the message with fake utm_ stuff if the message
has a contribution_tracking_id.

Bug: T176923
Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
M sites/all/modules/wmf_audit/wmf_audit.module
2 files changed, 8 insertions(+), 4 deletions(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index ac49482..6aa846b 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -273,7 +273,7 @@
         * actually make qc choke. Not so necessary with WP, but this will need 
to
         * happen elsewhere, probably. Just thinking ahead.
         * @param array $record transaction data
-        * @return type The normalized data we want to send.
+        * @return array The normalized data we want to send.
         */
        protected function normalize_partial( $record ) {
                //@TODO: Still need gateway account to go in here when that 
happens.
@@ -743,8 +743,12 @@
                                foreach ( $tryme as $date => $missing ) {
                                        if ( (int) $date <= (int) $cutoff ) {
                                                foreach ( $missing as $id => 
$message ) {
-                                                       
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
-                                                       $all_data = 
array_merge( $message, $contribution_tracking_data );
+                                                       if ( empty( 
$message['contribution_tracking_id'] ) ) {
+                                                               
$contribution_tracking_data = wmf_audit_make_contribution_tracking_data( 
$message );
+                                                               $all_data = 
array_merge( $message, $contribution_tracking_data );
+                                                       } else {
+                                                               $all_data = 
$message;
+                                                       }
                                                        $sendme = 
$this->normalize_partial( $all_data );
                                                        
wmf_audit_send_transaction( $sendme, 'main' );
                                                        $made += 1;
diff --git a/sites/all/modules/wmf_audit/wmf_audit.module 
b/sites/all/modules/wmf_audit/wmf_audit.module
index da762c3..59a1a61 100644
--- a/sites/all/modules/wmf_audit/wmf_audit.module
+++ b/sites/all/modules/wmf_audit/wmf_audit.module
@@ -109,7 +109,7 @@
  * Not even a big deal if we overshoot and remove too many, because we'll just
  * remake them next time if they're missing.
  * @param string $date The date string for the oldest log we want to keep
- * @param string $working_logs path to working logs directory
+ * @param array $working_logs list of working log files by date
  */
 function wmf_audit_remove_old_logs($date, $working_logs) {
   if (!empty($working_logs)) {

-- 
To view, visit https://gerrit.wikimedia.org/r/381360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I62d63bc53c2ed6c00bcf999bf5eb7e9a7730ada0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <ej...@ejegg.com>
Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to