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

reporting#10 - fix pagination on Contribution Detail report #13665

Closed
wants to merge 1 commit into from

Conversation

MegaphoneJon
Copy link
Contributor

Overview

The Contribution Detail report doesn't show pagination when Full Group By is enabled.

Before

selection_805

After

selection_804

Technical Details

There were 2.5 bugs that needed to be fixed:

  • The first temp table for this report sets a limit of 50 rows - so the second time through buildQuery(), the SQL statement SELECT * FROM civireport_contribution_detail_temp3 $this->_orderBy will never return more than 50, so the pager won't be set.
  • setPager() assumes that a) the last SQL statement executed includes SQL_CALC_FOUND_ROWS; b) that $this->limit is set.

Finally, I found a call to setPager() in a place where it would never be correct (on a temp table that's not the "final" temp table) so I removed it.

Comments

I tried writing a test - but I couldn't determine how to write a method of CiviReportTestCase or CiviUnitTestCase that retrieved the template object. I know it's a protected property of the report object, which is retrievable by getReportObject(). If that method existed, I could write the test.

@civibot
Copy link

civibot bot commented Feb 22, 2019

(Standard links)

@eileenmcnaughton
Copy link
Contributor

@MegaphoneJon the report tests are usually in api_v3_ReportTemplateTest - but I think you are saying there is something more than what is there you need

@eileenmcnaughton
Copy link
Contributor

closing as this is now in master via the rc PR

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