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

dev/core#1979 - Incorrect comparison of status_id when changing status of linked cases #18309

Merged
merged 1 commit into from
Sep 7, 2020

Conversation

demeritcowboy
Copy link
Contributor

Overview

https://lab.civicrm.org/dev/core/-/issues/1979

  1. Create a case.
  2. Create another case.
  3. Create a link cases activity and link them.
  4. Create a change case status activity and check the box to update related cases.
  5. Click save.

It ends up working anyway and updating the other case but it's not comparing 'status_id' properly because the field available is actually a label called 'case_status', and you get an E_NOTICE telling you that: Undefined index: status_id in CRM_Case_Form_Activity_ChangeCaseStatus::beginPostProcess() (line 137 of .../CRM/Case/Form/Activity/ChangeCaseStatus.php).

Technical Details

It works because it ends up updating cases it doesn't need to update by changing them to the same as they already are. The other option was to just remove the if and let it continue to update those.

if ($currentCase['status_id'] != $params['case_status_id']) {

Comments

Has test

@civibot
Copy link

civibot bot commented Sep 1, 2020

(Standard links)

@civibot civibot bot added the master label Sep 1, 2020
@eileenmcnaughton
Copy link
Contributor

@lcdservices any chance you can review?

@eileenmcnaughton
Copy link
Contributor

or maybe @jitendrapurohit

@jitendrapurohit
Copy link
Contributor

was able to replicate the e-notice and confirm that the PR seems to fix it. The unit test asserts the fix correctly so think it is good to merge 👍

@demeritcowboy
Copy link
Contributor Author

Thanks @jitendrapurohit !

@yashodha
Copy link
Contributor

yashodha commented Sep 7, 2020

@demeritcowboy @jitendrapurohit looks good, merging this.

@yashodha yashodha merged commit 05634e8 into civicrm:master Sep 7, 2020
@demeritcowboy demeritcowboy deleted the link-cases-change-status branch September 7, 2020 14:00
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