Skip to content
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

Remove unnecessary, and possibly incorrect query from email update #16079

Merged
merged 1 commit into from
Dec 26, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Removes an unnecessary & possibly occasionally harmful query.

Before

Unnecessary query on each email update, possibly wrong outcome

After

Query only runs when it should - that scenario now tested

Technical Details

When updating an email the comments pretty clearly say to update bulkmail if it is 1 but the current if clause
picks up anything other than 'null' - which is invalid for a boolean field. This creates an additional query which has some
locking risk being in a high volume place. In addition it seems like it could be a bug in some cases

Comments

@civibot
Copy link

civibot bot commented Dec 11, 2019

(Standard links)

@civibot civibot bot added the master label Dec 11, 2019
When updating an email the comments pretty clearly say to update bulkmail if it is 1 but the current if clause
picks up anything other than 'null' - which is invalid for a boolean field. This creates an additional query which has some
locking risk being in a high volume place. In addition it seems like it could be a bug in some cases
*
* @throws \CRM_Core_Exception
*/
public function testSetBulkEmail() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton what if you set the multiple billing settings so you end up with multiple bulk mailing emails or whatever it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seamuslee001 I didn't aim to cover all the scenarios - I think this is enough additional test cover for this change

@colemanw
Copy link
Member

Looks good. Tests pass.

@colemanw colemanw merged commit ef9684f into civicrm:master Dec 26, 2019
@colemanw colemanw deleted the email branch December 26, 2019 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants