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-21538: Field not found when sorting report by Case Type as a section header #11419

Merged
merged 1 commit into from
Dec 17, 2017

Conversation

octo-happiness
Copy link

@octo-happiness octo-happiness commented Dec 16, 2017

Overview

Attempting to create a Case Detail report sorted by the field Case Type with the option "Section Header" checked does not work.

Before

Creating a case detail report with this sorting configuration:

obraz

causes application to crash. The error is:

Unknown column 'case_civireport.case_type_name' in 'field list'

After

With this small change report generates as expected.

Comments

It appears that this field (added in CRM-20368 PR) requires special handling.


@civicrm-builder
Copy link

Can one of the admins verify this patch?

@colemanw
Copy link
Member

@civicrm-builder add to whitelist

@colemanw
Copy link
Member

@octo-happiness congrats on your first PR to CiviCRM 🥇
You've done a great job finding and documenting the bug, and providing what looks like a good solution.
As you can see our bot is very picky about syntax to keep our code clean, so the line you added needs to be indented by 2 fewer spaces (we use 2 spaces for indentation not 4). Typically when fixing minor things like that I'll do git commit --amend and git push --force to overwrite the previous commit and erase the mistake.

@octo-happiness
Copy link
Author

Sorry for the spaces, I've missed the difference. Fixed now.

@colemanw
Copy link
Member

I'm not able to reproduce the bug on my local setup. What version of CiviCRM are you using? What columns do you have enabled in the report? What extensions are you using?

@octo-happiness
Copy link
Author

I've tested it on CiviCRM 4.7.27, with no extensions enabled.

Report type: Case Detail
Selected columns:

  • Subject
  • Client Name

Sorting:

  • Case Type, ascending, with option "Section Header" checked

I can also replicate it on demo.circle-interactive.co.uk, I've made a screencap:
case_details4

@colemanw
Copy link
Member

Ah, that screencap helps, thank you. It was the "Section Header/Group By" checkbox I was missing. Now I can reproduce it and verify that your patch solves the problem.

@colemanw colemanw merged commit c865af6 into civicrm:master Dec 17, 2017
@colemanw
Copy link
Member

@octo-happiness thanks again for a clean well documented PR. May you have a long and happy career contributing to CiviCRM 🎉

sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
CRM-21538: Field not found when sorting report by Case Type as a section header
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.

3 participants