Fix: stop reentrancy loop when reassigning tech and group - #484
Merged
Conversation
Lainow
approved these changes
Aug 14, 2026
stonebuzz
requested changes
Aug 17, 2026
|
|
||
| self::removeAssignUsers($item); | ||
| // Deferred to pre_item_add (Ticket_User/Group_Ticket): removing here re-enters and loops. | ||
| $_SESSION['plugin_escalade']['pending_remove_assign_users'][$item->getID()] = true; |
Contributor
There was a problem hiding this comment.
pending_remove_assign_users (set here) and keep_new_assign_users (line 288) are stored in $_SESSION, but the handoff they implement only ever spans a single request: pre_item_update() sets the flag, and a nested pre_item_add hook fired later in the same Ticket::update() call consumes it. If that expected follow-up add never happens (a rule blocks the group/tech add, an exception aborts the request, GLPI dedupes the add before pre_item_add fires), the flag is never cleared and stays in $_SESSION across requests. The next unrelated actor addition on that same ticket, possibly much later in the same session, would then unexpectedly trigger removeAssignUsers()
stonebuzz
approved these changes
Aug 17, 2026
RomainLvr
approved these changes
Aug 17, 2026
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
The old assign removal is now deferred to the moment the new actor is actually added, instead of running synchronously during the ticket update, which broke the re-entrancy.
Screenshots (if appropriate):