-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incoming SMS replies are not linked to CiviCRM Contacts #26997
base: master
Are you sure you want to change the base?
Conversation
Thank you for contributing to CiviCRM! ❤️ We will need to test and review the PR. 👷 Introduction for new contributors
Quick links for reviewers |
@civicrm-builder retest this please |
CRM_SMS_ProviderTest::testProcessInbound |
This seems to be blocked on the test fail but it's not obvious why it would fail from skimming the code - let's run again - test this please |
test this please - maybe something has changed.... |
CRM_SMS_ProviderTest::testProcessInbound |
@@ -207,7 +207,7 @@ public function processInbound($from, $body, $to = NULL, $trackID = NULL) { | |||
if (!$message->toContactID) { | |||
// find recipient if $toContactID not set by hook | |||
if ($message->to) { | |||
$message->toContactID = CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone LIKE %1", [ | |||
$message->toContactID = CRM_Core_DAO::singleValueQuery("SELECT contact_id FROM civicrm_phone JOIN civicrm_contact ON civicrm_contact.id = civicrm_phone.contact_id WHERE !civicrm_contact.is_deleted AND phone_numeric LIKE %1", [ | |||
1 => ['%' . $message->to, 'String'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off the top of my head, this is now comparing message->to to phone_numeric, but that's unlikely to match.
test this please |
OK - I think the issue is that this part can pass https://github.com/civicrm/civicrm-core/pull/29740/files because of the |
Overview
Incoming SMS replies are not linked to CiviCRM Contacts because the formatted phone number is used for a like comparison, whereas the phone_numeric provides a match.
Before
SMS reply is not linked to the correct CiviCRM Contact.
Related Activity is created with no subject line.
After
SMS reply is linked to the correct CiviCRM Contact.
Related Activity is created with useful subject line.
Technical Details
This PR has been in our PROD build for 3 years. Would be interested to know why no one else has found this problem.
Comments
Agileware Ref: CIVICRM-1521