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

report#24 - Case Detail report - fix 'Active role?' when no relationships #15972

Merged
merged 1 commit into from
Dec 17, 2019

Conversation

aydun
Copy link
Contributor

@aydun aydun commented Nov 27, 2019

Overview

The 'Active Role?' filter assumes relationships will exist and wrongly excludes them

Before

The 'Active Role?' filter only offers 'Yes' or 'No' - but both options exclude cases without relationships.

After

The 'Active Role?' filter offers 'Yes', 'No' or 'Any' - 'Yes' & 'No' operate as before when relationships exist. 'Any' does not exclude cases where no relationships exist.

Technical Details

Changes 'Active Role?' and 'Is Deleted?' to use default behaviour for booleans.

Comments

https://lab.civicrm.org/dev/report/issues/24

@civibot
Copy link

civibot bot commented Nov 27, 2019

(Standard links)

@civibot civibot bot added the master label Nov 27, 2019
@seamuslee001
Copy link
Contributor

ping @demeritcowboy @alifrumin

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@demeritcowboy
Copy link
Contributor

I can give it a spin. The case detail report has the problem but the case summary one seems like it was updated a while ago to allow "neither" and I can't reproduce on the summary report even with a case that has no relationships, but anyway it makes sense to standardize the code in both.

@demeritcowboy
Copy link
Contributor

It's good just have two easily fixable things.

  • General standards
    • [r-explain] PASS
      • Just the note that it's only the case detail report where I can reproduce it since the summary report was already updated a while ago.
    • [r-user] PASS
    • [r-doc] PASS
    • [r-run] PASS
      • There's a pre-existing issue where you can end up with duplicate rows in the summary report, but it's not because of the PR.
  • Developer standards
    • [r-tech] PASS
    • [r-code] Issue
      • This line also needs updating similar to line 377 in the summary report otherwise you get a slew of notices if you choose to display the deleted column: https://github.com/civicrm/civicrm-core/blob/5.19.3/CRM/Report/Form/Case/Detail.php#L696
      • But then that made me realize if you run a report and then export and you have 100,000 cases it's going to call that enhanced_boolean() function 100,000 times. For both reports, could the return value from enhanced_boolean() be put in a local variable and then use the local variable in alterDisplay?
    • [r-maint] Undecided
    • [r-test] PASS

@demeritcowboy
Copy link
Contributor

Actually the function call thing is probably a micro-optimization that's not necessary but the line in the detail report does need updating.

@yashodha
Copy link
Contributor

@aydun Do you think similar changes need to be made in other reports as well for deleted contacts ?

…hips

Change 'Active Role?' to use the default behaviour for CRM_Utils_Type::T_BOOLEAN and allow 'Any'
Change 'Is deleted?' to use standard CRM_Utils_Type::T_BOOLEAN
@aydun
Copy link
Contributor Author

aydun commented Dec 3, 2019

Thanks for testing @demeritcowboy I've changed the description to only report an issue in the Detail report.

The default behaviour for CRM_Utils_Type::T_BOOLEAN is ok, except that the reports were overriding some of that. This simpler version uses the defaults and also avoids rewriting the 'is_deleted'.

@yashodha - no, the revised changes bring this more into line with other reports.

@aydun aydun changed the title report#24 - Case Detail and Summary reports - fix 'Active role?' when no relationships report#24 - Case Detail report - fix 'Active role?' when no relationships Dec 3, 2019
@demeritcowboy
Copy link
Contributor

Looks good! It just creates one minor visual change in the output from before, but as noted above it's consistent with BOOLEAN in other reports.

  • General standards
    • [r-explain] PASS
    • [r-user] PASS
    • [r-doc] PASS
    • [r-run] PASS
      • Also checked that if you have a saved instance from before using these fields it still retains it.
      • (Minor Change) If you include the deleted column in the output, it no longer outputs the word "No" for non-deleted cases.
  • Developer standards
    • [r-tech] PASS
    • [r-code] PASS
    • [r-maint] Undecided
    • [r-test] PASS

@demeritcowboy
Copy link
Contributor

@yashodha or anyone are there any issues - this seems good to go?

@yashodha
Copy link
Contributor

@demeritcowboy Looks good, I am happy to merge.

@yashodha yashodha merged commit 4356a60 into civicrm:master Dec 17, 2019
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