dev/core#1652 - Check for change case type activity on case activity form doesn't work #16785
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
https://lab.civicrm.org/dev/core/issues/1652
This isn't the thing I was looking to fix but getting this out of the way will make it less distracting. I'm not sure what the scenario for this check is in real life but if all your case types are disabled then the intent seems to be that when you try to change a case type it will warn you when go to create a Change Case Type activity, but it's flawed in a couple ways. Given the rarity of the situation I've opted for the simple route of making the field required, so at least you don't get a fatal error on save.
To reproduce:
Technical Details
Detailed in lab ticket. Has name/label issues as well as a check against !something which seems to be wrong.
Since one of the deleted lines is an assignment of $session, I checked to see if it was used outside the deleted lines but it isn't.
Comments
Has test, which has nothing to do with this issue but it was ... hard ... so I opted for any kind of test. I'd argue the attached test is more useful, since it's for contact search which is used everywhere.