-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/mail#32 - Further checks - making mailing test email non-case-sensitive #13401
dev/mail#32 - Further checks - making mailing test email non-case-sensitive #13401
Conversation
(Standard links)
|
api/v3/Mailing.php
Outdated
@@ -637,7 +637,7 @@ function civicrm_api3_mailing_send_test($params) { | |||
$query = CRM_Utils_SQL_Select::from('civicrm_email e') | |||
->select(array('e.id', 'e.contact_id', 'e.email')) | |||
->join('c', 'INNER JOIN civicrm_contact c ON e.contact_id = c.id') | |||
->where('e.email IN (@emails)', array('@emails' => $testEmailParams['emails'])) | |||
->where('LOWER(e.email) IN (@emails)', array('@emails' => $testEmailParams['emails'])) |
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.
actually we don't need this LOWER - mysql is case insensitive - it's php we need to wrangle.
Note that using LOWER will significantly slow down the query - a slightly similar example is in this blog https://civicrm.org/blog/eileen/guppies-have-died-for-that-query (diff function but same underlying issue)
@martinh-pw thanks for this fix @eileenmcnaughton I've tested this PR with your amendment to remove LOWER from SQL. Can confirm this work. Nice fix. |
@eileenmcnaughton @jusfreeman Thanks :) Sorry but I'm unfamiliar with the process here, is there a way I should modify this PR somehow? Or to close it somehow and create a new one? |
@martinh-pw yes you can modify this - make the change & then do
Then you will have fixed up the commit. You can then force push it to your branch with
|
Update master from upstream
@eileenmcnaughton Done, nice trick! |
looks good |
As per https://lab.civicrm.org/dev/mail/issues/32
Further work in addition to #13392
No longer assuming existing contact emails will be lowercase in the db, now will match them in a case insensitive way as well.