reporting#10 - fix pagination on Contribution Detail report #13670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The Contribution Detail report doesn't show pagination when Full Group By is enabled.
Before
After
Technical Details
There were 2.5 bugs that needed to be fixed:
buildQuery()
, the SQL statementSELECT * 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 includesSQL_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
orCiviUnitTestCase
that retrieved the template object. I know it's a protected property of the report object, which is retrievable bygetReportObject()
. If that method existed, I could write the test.This is identical to #13665 but it's against the rc, per the request of @eileenmcnaughton.