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

CiviCase: fix case custom data values in Case Audit Report #16654

Closed
wants to merge 1 commit into from

Conversation

mlutfy
Copy link
Member

@mlutfy mlutfy commented Feb 28, 2020

Overview

To reproduce:

  • Create a new Case Custom Field of type "alphanumeric" and widget "checkbox", with a few options that use a numeric value, string label (ex: Case Type, "1 = Blue, 2 = Green").
  • Create a new Case
  • Print the Case Report

The custom field will be printed in numeric form, instead of string.

Before

Capture d’écran de 2020-02-28 16-53-26

After

Capture d’écran de 2020-02-28 16-55-43

Technical Details

To be perfectly honest, these CustomData BAOs are pretty scary and I'm not sure I am using them correctly. 🤷‍♂️

cc @demeritcowboy

@civibot
Copy link

civibot bot commented Feb 28, 2020

(Standard links)

}
}
}
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Case', NULL, $caseID);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to include the case type in the getTree() call. Otherwise it doesn't show custom fields that are specific to that case type. See e.g. https://github.com/civicrm/civicrm-core/blob/5.22.1/CRM/Case/Form/CaseView.php#L146

{foreach from=$group.fields item=row}
<tr>
<th class="label">{$row.field_title}</td>
<td class="crm-case-report-custom-field">{$row.field_value}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be |escape'd, but I see it doesn't escape them on manage case either. Hmm.

@mattwire mattwire added the needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state label Mar 5, 2020
@jaapjansma
Copy link
Contributor

Betty and I are reviewing PRs and we came across this one. It has the label needs work and @demeritcowboy has given a review. @mlutfy are you still going to work on this PR? If not we would advice to close this PR.

@mlutfy
Copy link
Member Author

mlutfy commented May 25, 2020

Thanks for the reminder. I'll try to have another look at it.

@eileenmcnaughton
Copy link
Contributor

@mlutfy I'll close this for now as it's needs-work + stale - please re-open when ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants