-
-
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
dev/core#212 - Contribution Details report fails when 'Is not one of'… #12406
Conversation
(Standard links)
|
@jitendrapurohit I want to suggest an alternate unit test approach - this one is an adjusted one that can work in the ReportTemplateTest class
|
I also tried this
It's not quite working - but I think I may have the id field wrong. That setFromBase adds the acl & group join so I feel like that is nearly the same |
Ah, thanks for the above test. It actually found another similar issue with repeat contribution report. I've updated the PR to include the fix for the same 👍 |
Remaining fail is just about the need to clean up temporary tables. @totten is there any recommendation for doing this differently now that we have some new routines around temp tables - e.g something cleverer than adding to the tearDown CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS 'civireport_contribution_detail_temp1'); |
@jitendrapurohit TBH I think the fix might be a bit narrow (one operator only - notin but not in) - I don't need that changed since we have a unit test but maybe a code note to say that line is covered by tests to give people confidence to alter later. |
@@ -364,7 +364,7 @@ public function testLybuntReportWithFYData() { | |||
SELECT SQL_CALC_FOUND_ROWS contact_civireport.id as cid FROM civicrm_contact contact_civireport INNER JOIN civicrm_contribution contribution_civireport USE index (received_date) ON contribution_civireport.contact_id = contact_civireport.id | |||
AND contribution_civireport.is_test = 0 | |||
AND contribution_civireport.receive_date BETWEEN \'20140701000000\' AND \'20150630235959\' | |||
|
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.
The failing test is due to this whitespace removal by my editor 🤦♂️ . Will update the PR with the fix.
… condition is used for Groups field
OK - I'm happy with this - thanks @jitendrapurohit ! |
… condition is used for Groups field
Overview
Fix DB error when contribution detail report is filtered by
is not one of
Group operatorBefore
After
Filtering on
is not one of
group operator correctly displays all contacts which are not in any selected group.Technical Details
Contribuiton Detail Report uses a custom from clause to build the soft credit rows. It missed the group join if there is a temp table already created.
Comments
Added a small unit test to check for any DB failure when group by filter is applied.
Gitlab Ticket - https://lab.civicrm.org/dev/core/issues/212