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

Alternate to #16650 - On Case Audit/Print Report richtext details field is getting escaped when system is non-english #16659

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

demeritcowboy
Copy link
Contributor

Overview

When the system isn't english the case audit/print report has visible html tags in the output for the Details field.

Alternative to PR #16650 which is shorter but compares against possibly future-changing text.

Technical Details

The field labels it was comparing against are translated field labels so they don't match up.

It looks like a lot of code, but most of it is clerical where it is just adding in a non-changing name counterpart to the label whereever it shows up. The only functional change is in templates/CRM/Case/Audit/Report.tpl.

I'm struggling writing a new test for this because

  • When the system isn't english, then even before the part the patch addresses the audit/print report throws a whole bunch of E_WARNING's related to sorting so I would need to fix those first, and
  • When I try anyway, there's some undefined indexes which may or may not be related to the sorting and I didn't get into tracking that down.

Comments

Also noting the original use of the label as a css class in the tpl would always have been problematic because of spaces, but I resisted trying to also fix that, and a few other things, here.

I've left out addressing custom fields pending #16654

@mlutfy

@civibot
Copy link

civibot bot commented Feb 29, 2020

(Standard links)

@civibot civibot bot added the master label Feb 29, 2020
@mlutfy
Copy link
Member

mlutfy commented Feb 29, 2020

This is really nice, thank you! I will test as soon as I can, but on code-review, it seems like a much cleaner fix.

@jaapjansma
Copy link
Contributor

test this please

1 similar comment
@jaapjansma
Copy link
Contributor

test this please

@jaapjansma
Copy link
Contributor

  • General standards
    • Explain (r-explain)
      • PASS : The goal/problem/solution have been adequately explained in the PR.
      • COMMENTS: We discovered that we had to set CiviCRM to French. In Dutch the problem did not occur.
    • User impact (r-user)
      • PASS: The change would be intuitive or unnoticeable for a majority of users who work with this feature.
    • Documentation (r-doc)
      • PASS: The changes do not require documentation.
    • Run it (r-run)
      • PASS: We tested in noth dmaster and in the test. First we put CiviCRM in Ducth but then the problem did not occur. In French and Norwegian the problem occurs.
  • Developer standards
    • Technical impact (r-tech)
      • PASS: The change preserves compatibility with existing callers/code/downstream.
    • Code quality (r-code)
      • PASS: The functionality, purpose, and style of the code seems clear+sensible.
    • Maintainability (r-maint)
      • PASS: The change is trivial enough that it does not require tests.
    • Test results (r-test)
      • PASS: The test results are all-clear.

@eileenmcnaughton or @mattwire could you merge this PR?

@demeritcowboy
Copy link
Contributor Author

Ahh in Dutch, at least in civi, the translation for Details is Details, so it's the same as english.

@seamuslee001
Copy link
Contributor

Merging based on @jaapjansma and Betty's testing

@seamuslee001 seamuslee001 merged commit f9a004f into civicrm:master Mar 23, 2020
@demeritcowboy demeritcowboy deleted the name-label-print-report branch March 23, 2020 22:43
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.

4 participants