-
-
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
CRM-21677 - reduce unnecessary address joins on activity & contact detail reports #11855
Conversation
CRM/Report/Form/ActivitySummary.php
Outdated
ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND | ||
{$this->_aliases['civicrm_phone']}.is_primary = 1 "; | ||
} | ||
$this->joinPhoneFromClause(); |
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.
should be joinPhoneFromContact()
?
CRM/Report/Form/ActivitySummary.php
Outdated
ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND | ||
{$this->_aliases['civicrm_email']}.is_primary = 1 "; | ||
} | ||
$this->joinEmailFromClause(); |
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.
another typo - should be joinEmailFromContact()
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.
ug I took from the wrong version! That was one of the things I fixed when I did my cut
https://github.com/civicrm/civicrm-core/pull/11814/files#diff-35417c3a249b354869b9e25ca48e9d5cR585
90afe51
to
e3c74b6
Compare
@jitendrapurohit fixed now - right version of those changes, one more report in the commit too now |
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.
Tested the functionality of all the modified reports. They seem to be working fine 👍
thanks @jitendrapurohit - I'll merge once tests complete then & rebase these changes out of the main PR with these changes |
Overview
Improve efficiency of joins in these reports
Before
unnecessary joins to phone, email and address tables
After
join only when needed, code standardised
Technical Details
This also aligns the approach with that used in the extended report extension - there might be some notices as I have updated the extension where the signature differs from core but will need to drop a new release & people will need to be on it.
Comments
Sub-commit of #11814 which in itself is a reviewer's cut of #11550 - I have just included the files for changes for 3 reports here
In order to get the first chunk reviewed & merged (as I fear #11814 will languish due to the number of reports affected)
@yashodha hoping you can review & merge this or that @jitendrapurohit can review to get your original PR cleared away