Katie Horn has submitted this change and it was merged.

Change subject: Apparently Civi only likes names 64 Chars or Less
......................................................................


Apparently Civi only likes names 64 Chars or Less

Change-Id: Id05bb3b70cfff610e1d6bd3c1edf7dfa01a3f72c
---
M sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
1 file changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Katie Horn: Verified; Looks good to me, approved



diff --git a/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
index 416373f..95c6b79 100644
--- a/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_common/wmf_civicrm/wmf_civicrm.module
@@ -694,14 +694,17 @@
     }
   
     // Create the contact record
+       $fname = substr( trim( $msg['first_name'] ), 0, 64 );
+       $mname = substr( trim( $msg['middle_name'] ), 0, 64 );
+       $lname = substr( trim( $msg['last_name'] ), 0, 64 );
     $contact = array(
         'id' => $contact_id,
         'contact_type' => $msg['contact_type'],
-        'first_name' => $msg['first_name'],
-        'middle_name' => $msg['middle_name'],
-        'last_name' => $msg['last_name'],
-        'sort_name' => trim( $msg['last_name'] . ', ' . $msg['first_name'], ' 
,' ),
-        'display_name' => trim( $msg['first_name'] . ' ' . $msg['last_name'] ),
+        'first_name' => $fname,
+        'middle_name' => $mname,
+        'last_name' => $lname,
+        'sort_name' => substr( trim( $lname . ', ' . $fname, ' ,' ), 0, 128 ),
+        'display_name' => substr( $fname . ' ' . $lname, 0, 128 ),
         'do_not_trade' => $msg['anonymous'],
         'is_opt_out' => '0', // $msg['optout'], // we don't offer an option to 
unsub on contrib, eliminate bugs
         'contact_source' => $msg['contact_source'],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id05bb3b70cfff610e1d6bd3c1edf7dfa01a3f72c
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to