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

CRM-20969 Fix issues in order by clauses of reports showing errors in 7.1 #10765

Merged
merged 4 commits into from
Jul 30, 2017

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented Jul 25, 2017

@seamuslee001
Copy link
Contributor Author

ping @monishdeb @eileenmcnaughton does this make sense to both of you?

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 - alternative proposal #10779

@@ -227,11 +227,11 @@ public function orderBy() {
foreach ($this->_columns as $tableName => $table) {
if (array_key_exists('order_bys', $table)) {
foreach ($table['order_bys'] as $fieldName => $field) {
$this->_orderBy[] = $field['dbAlias'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to simply remove this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to try that in this PR as i think that is a separate issue to deal with, This is just about making sure these reports pass php7.1

@@ -268,25 +268,25 @@ public function groupBy() {
)) {
$append = '';
}
$this->_groupBy[] = "$append {$this->_params['group_bys_freq'][$fieldName]}({$field['dbAlias']})";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully this whole function can go too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm - If I'm going to test out these reports I'd rather test the 'right' change. I just tested the Walklist report - with the existing (non 7.1 compliant) order by function sort by ascending works, sort by descending does not work, section break does not work. Removing the order by function causes it to work correctly (and fixes your php problem) - note the walklist report needs to be enabled under manage templates.

seamuslee001 and others added 3 commits July 30, 2017 09:41
I am proposing this as an alternate approach for fixing the 7.1 errors.

Note this only covers one report - I think we should move that function which is actually
generic to the parent class, however I think the one in contribute.summary is
a bit more nuanced.

Note this is also the approach taken by the extendedreport
extension (which takes it a little further). I will remove the declaration of
groupByArray from that extension if we add it here

I do have a medium term plan to move a lot of the helpers from extended report back into core.

Change-Id: I377d33a7417ff93169f12ccbda77f3662da5bac1
@seamuslee001
Copy link
Contributor Author

@eileenmcnaughton i have removed the orderBy Function given your testing, The groupBy ones seem to be more indivualised to the reports so i think they should be held onto, Only the walklist had issues with orderBy the others had issues with groupBy

@eileenmcnaughton
Copy link
Contributor

Actually they are not so much individualised as copy & pasted at different stages of development :-). If we overwrote the parent groupBy with the one from pledgeSummary we could remove it from most reports. However, I think we have met the requirement of including some code improvement in this PR so I'm OK to merge now

@monishdeb
Copy link
Member

Merging as per tag

@monishdeb monishdeb merged commit e0d232f into civicrm:master Jul 30, 2017
@eileenmcnaughton eileenmcnaughton deleted the report_fixes branch July 30, 2017 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants