Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311491

Change subject: Reply on CiviCRM address rather than contribution tracking 
language.
......................................................................

Reply on CiviCRM address rather than contribution tracking language.

Bug: T96410
Change-Id: Icc03b7162209b877905a7f12718b67657dcce338
---
M silverpop_export/update_table.sql
1 file changed, 2 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/91/311491/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 963524d..b839200 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -63,7 +63,7 @@
   (id, contact_id, email, first_name, last_name, preferred_language, opted_out)
   SELECT
     e.id, e.contact_id, e.email, c.first_name, c.last_name,
-    IF(SUBSTRING(c.preferred_language, 1, 1) = '_', 'en', 
SUBSTRING(c.preferred_language, 1, 2)),
+    SUBSTRING(c.preferred_language, 1, 2),
     (c.is_opt_out OR c.do_not_email OR e.on_hold OR COALESCE(d.do_not_solicit, 
0))
   FROM civicrm.civicrm_email e
   LEFT JOIN civicrm.civicrm_contact c ON e.contact_id = c.id
@@ -74,7 +74,7 @@
     AND e.is_primary = 1;
 
 -- Find the latest donation for each email address. Ordering by
--- recieve_date and total_amount descending should always insert 
+-- receive_date and total_amount descending should always insert
 -- the latest donation first, with the larger prevailing for an
 -- email with multiple simultaneous donations. All the rest for
 -- that email will be ignored due to the unique constraint. We
@@ -102,21 +102,6 @@
     ct.receive_date DESC,
     ct.total_amount DESC
 ON DUPLICATE KEY UPDATE latest_currency = 
silverpop_export_latest.latest_currency;
-
--- Populate data from contribution tracking, because that's fairly
--- reliable. Do this before deduplication so we can attempt to make
--- intelligent fallbacks in case of null data
--- (11 minutes)
-UPDATE
-    silverpop_export_staging ex,
-    civicrm.civicrm_contribution ct,
-    drupal.contribution_tracking dct
-  SET
-    ex.preferred_language = dct.language
-  WHERE
-    ex.contact_id = ct.contact_id AND
-    dct.contribution_id = ct.id AND
-    dct.language IS NOT NULL;
 
 -- (15 minutes)
 UPDATE

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc03b7162209b877905a7f12718b67657dcce338
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org>

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

Reply via email to