Skip to content

Fix: stop reentrancy loop when reassigning tech and group - #484

Merged
Rom1-B merged 2 commits into
mainfrom
support_45821
Aug 17, 2026
Merged

Fix: stop reentrancy loop when reassigning tech and group#484
Rom1-B merged 2 commits into
mainfrom
support_45821

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes #45821
  • Reassigning a ticket's technician and group at the same time could trigger an infinite loop and a Gateway Timeout.
    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):

Comment thread inc/ticket.class.php Outdated

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

@Rom1-B
Rom1-B requested a review from stonebuzz August 17, 2026 07:46
@Rom1-B
Rom1-B merged commit e0b4ca4 into main Aug 17, 2026
3 checks passed
@Rom1-B
Rom1-B deleted the support_45821 branch August 17, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants