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

fix contribution summary report's statistics when grouping and having #16467

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

sluc23
Copy link
Contributor

@sluc23 sluc23 commented Feb 4, 2020

Overview

Fixes Contribution Summary Report statistics values, when grouping by any other field than currency, and filtering by any aggregate criteria (HAVING)

civicrm_bug1110

Before

Report statistics shows wrong amounts (total amount, average, count)

After

Report statistics shows correct amounts (total amount, average, count)

Technical Details

In public function statistics(&$rows) the query generated to get the values is not using the same groupBy than the main query, it is hardcoded the groupBy only by currency, so the results might be different when an aggregate (HAVING) filter is selected in the report

Comments

Gitlab issue here 1110

@civibot
Copy link

civibot bot commented Feb 4, 2020

(Standard links)

@civibot civibot bot added the master label Feb 4, 2020
@sluc23
Copy link
Contributor Author

sluc23 commented Feb 4, 2020

this test has failed... not sure if it's related or not..

api\v4\Entity\ConformanceTest::testConformance
Undefined index: user_name

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

@sluc23 I agree the test fail is unrelated - I tested this & could replicate the bug & the fix

However, it did create some e-notices

Screen Shot 2020-02-05 at 4 39 47 PM

Also note that we are switching array() to [] where we touch relevant code

@sluc23
Copy link
Contributor Author

sluc23 commented Feb 5, 2020 via email

@sluc23
Copy link
Contributor Author

sluc23 commented Feb 6, 2020

@eileenmcnaughton what's the rule in this case, should I use array [ ] notation just in my new lines of code, or should I refactor any array() appearance in the whole Form ?

This Form still has plenty of array( ) notation

@sluc23
Copy link
Contributor Author

sluc23 commented Feb 7, 2020

test this please

@eileenmcnaughton
Copy link
Contributor

@sluc23 yeah - generally I replace all the arrays in a file before I start working on it - I generally push up a commit just doing that & by the time my bug is fixed that is normally merged (if you make it clear in the header what it is it moves quickly).

I think the minimum is no new instances of array()

@sluc23
Copy link
Contributor Author

sluc23 commented Feb 12, 2020

@eileenmcnaughton looks good now? any other req to merge this PR? tx!

@eileenmcnaughton
Copy link
Contributor

I retested & the enotices are gone now - fix still works - merging

@eileenmcnaughton eileenmcnaughton merged commit 9f12719 into civicrm:master Feb 14, 2020
@eileenmcnaughton
Copy link
Contributor

@sluc23 might be this caused https://lab.civicrm.org/dev/core/issues/1596

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.

2 participants