Skip to content

Fix (link ticket to problem) missing entity check when linking tickets to a problem via massive action#24831

Open
Herafia wants to merge 5 commits into
glpi-project:10.0/bugfixesfrom
Herafia:fix/massive-action-link-ticket-to-problem-entity-check
Open

Fix (link ticket to problem) missing entity check when linking tickets to a problem via massive action#24831
Herafia wants to merge 5 commits into
glpi-project:10.0/bugfixesfrom
Herafia:fix/massive-action-link-ticket-to-problem-entity-check

Conversation

@Herafia

@Herafia Herafia commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !45187
  • When linking tickets to a problem via the "Link to a problem" massive action, no entity restriction was applied, allowing tickets from unrelated entities to be linked. The problem dropdown is now filtered by the active session entity, and each ticket is validated against the problem's entity before the link is created. This aligns the massive action behavior with the existing manual linking logic in Problem_Ticket.

Screenshots (if appropriate):

@Herafia Herafia self-assigned this Jul 10, 2026
@Herafia Herafia added the bug label Jul 10, 2026
@Herafia Herafia changed the title Fix (link ticket to problem) missing entity check when linking ticket… Fix (link ticket to problem) missing entity check when linking tickets to a problem via massive action Jul 10, 2026
@Herafia Herafia requested review from Rom1-B and stonebuzz July 10, 2026 10:26

@Rom1-B Rom1-B left a comment

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.

No test covers link_to_problem (src/Ticket.php:2917-2990), and none is added. Missing cases:

  • same-entity (accepted)
  • cross-entity non-recursive (rejected)
  • recursive parent problem on child-entity ticket (accepted)

@Herafia Herafia requested a review from Rom1-B July 10, 2026 12:42

@stonebuzz stonebuzz left a comment

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.

with tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants