Repository navigation
Fix add/delete user to group 0 via provisioning API - #29994
Conversation
| $groupId = !empty($_POST['groupid']) ? $_POST['groupid'] : null; | ||
| if($groupId === null) { | ||
| $groupId = $_POST['groupid']; | ||
| if (($groupId === '') || ($groupId === null) || ($groupId === false)) { |
There was a problem hiding this comment.
Note: this uses the same style of check that was done in Groups.php addGroup a while ago.
48e77b4 to
6818211
Compare
Codecov Report
@@ Coverage Diff @@
## master #29994 +/- ##
=========================================
Coverage 58.21% 58.21%
- Complexity 18508 18512 +4
=========================================
Files 1093 1093
Lines 63693 63693
=========================================
Hits 37082 37082
Misses 26611 26611Continue to review full report at Codecov.
|
|
Note: the 2nd commit is needed because the test scenarios are not independent. The scenarios do not seem to clean up their state (in this case which users are in which groups) at the end of each scenario. As a separate issue, that should all be sorted out some day. |
|
Looks good, should we add tests that test really empty group names? |
|
This scenario seems to send an empty groupid: |
|
Backport stable10 #30004 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Those scenarios fail, so fix the code:
empty()function - test explicitly for the things that are "empty" apart from0.Related Issue
#29990
Motivation and Context
Remove more uses of
empty()that cause problems for data that has the valid value "0".How Has This Been Tested?
Run the API tests locally.
Types of changes
Checklist: