fix(commoninjectionlib.class.php): normalize group assignment fields for assignable items only#631
Open
TarekRemo wants to merge 3 commits into
Open
fix(commoninjectionlib.class.php): normalize group assignment fields for assignable items only#631TarekRemo wants to merge 3 commits into
TarekRemo wants to merge 3 commits into
Conversation
…for assignable items only
Contributor
|
I would appreciate having a unit test covering this part in order to definitively address the issue, as it has come up several times. This would also provide a good starting point for building our unit test coverage.Ideally, this should be validated with a real test involving the injection of a CSV file. |
Contributor
Author
I added unit tests. Didn't use a real CSV file but the tests simulate the starting point when a real CSV is injected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Checklist before requesting a review
Please delete options that are not relevant.
Description
groups_id → _groups_id(array)) was triggered for any item with a search option pointing toglpi_groups. Some items (example:ITILCategory) storegroups_idas a direct integer FK, not viaGroup_Item. For these items, the_groups_idarray this block produced was silently ignored, leavinggroups_id = 0.AssignableItemtrait to the guard condition. The rewrite now only happens for items likeComputerthat actually has this trait and expect group assignments throughGroup_Itemrelations.