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
[REF] Reverse if statement
Before
Code sets and then conditionally unsets
After
Code conditionally sets
Technical Details
This splits out a minor code cleanup from #18196 (which is mostly stalled on needs test - #21210 can help with a starting point on that)
I should note that I actually came up with a different result from
https://github.com/civicrm/civicrm-core/pull/18196/files#diff-7117b779a415ec834465eaeffeaddfd50a003a8dab1b11192133adc264960727R60-R63
I compared the two AFTER I created this PR and found the difference. I think mine is right but need some more eyes
if (hasPermission OR isselfService)
compared to the original
if (!hasPermission && !isSelfService)
EDIT - change of heart - I've altered again - but really this should be partly split to https://github.com/civicrm/civicrm-core/pull/20210/files#diff-7117b779a415ec834465eaeffeaddfd50a003a8dab1b11192133adc264960727R110 so I now have doubts about merging this when that is not merged
Comments