Repository navigation
Conversation
Herafia
force-pushed
the
fix/tag-associate-item
branch
3 times, most recently
from
August 21, 2026 13:42
2b655a6 to
0a31762
Compare
stonebuzz
requested changes
Aug 21, 2026
Rom1-B
reviewed
Aug 24, 2026
stonebuzz
requested changes
Aug 27, 2026
stonebuzz
reviewed
Aug 28, 2026
Herafia
force-pushed
the
fix/tag-associate-item
branch
from
October 2, 2026 14:11
a45eb0d to
364ee83
Compare
Herafia
force-pushed
the
fix/tag-associate-item
branch
from
October 2, 2026 14:18
364ee83 to
123a2a6
Compare
Co-authored-by: Stanislas <skita@teclib.com>
Co-authored-by: Stanislas <skita@teclib.com>
Herafia
force-pushed
the
fix/tag-associate-item
branch
from
October 6, 2026 08:41
123a2a6 to
65c739b
Compare
Rom1-B
approved these changes
Oct 6, 2026
Contributor
|
Fix should be added to GLPI 11 version too |
Rom1-B
requested changes
Oct 7, 2026
| if (!$item->getFromDB($item_id) || !$item->canUpdateItem()) { | ||
| throw new AccessDeniedHttpException(__s('You do not have permission to update this item', 'tag')); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Missing entity-scope check: nothing here verifies the item's entity is within the tag's scope (entities_id + is_recursive), so a tag can be associated to an out-of-scope item. The 12.0-bf branch already carries this check; can you port it here?
Suggested change
| $item = new $itemtype(); | |
| if (!$item->getFromDB($item_id) || !$item->canUpdateItem()) { | |
| throw new AccessDeniedHttpException(__s('You do not have permission to update this item', 'tag')); | |
| } | |
| if ( | |
| isset($item->fields['entities_id']) | |
| && $tag->fields['entities_id'] != $item->fields['entities_id'] | |
| && ( | |
| !$tag->fields['is_recursive'] | |
| || !in_array($tag->fields['entities_id'], getAncestorsOf('glpi_entities', (string) $item->fields['entities_id'])) | |
| ) | |
| ) { | |
| throw new AccessDeniedHttpException(__s('This tag is not available in the item entity', 'tag')); | |
| } | |
stonebuzz
requested changes
Oct 8, 2026
| $this->isItemTagged($ticket, $tagID2); | ||
| } | ||
|
|
||
| public function testTagOutOfEntityScopeIsNotLinked(): void |
Contributor
There was a problem hiding this comment.
testTagOutOfEntityScopeIsNotLinked() (present on 11.0/bugfixes, guards PluginTagTagItem::keepVisibleTags()) is deleted and its body replaced by the new test, with no explanation in the description. It covers a different code path (ticket form tag processing) and should be kept alongside the new test, not overwritten.
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
Regression : The file front/tag.form.php, which handled this association, had been accidentally deleted in an unrelated commit. The request was then processed by the generic mechanism, which created a tag instead of establishing the association.
Fix : re-enable correct processing of the tag/item association.
Screenshots (if appropriate):