-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(itil): Linked itilobject should return the child entities itilobject #21680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 11.0/bugfixes
Are you sure you want to change the base?
fix(itil): Linked itilobject should return the child entities itilobject #21680
Conversation
ab4bfe5 to
4f61140
Compare
ed8a6e6 to
ac08664
Compare
cedric-anne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data-testid attributes should probably contains something that looks like a valid HTML ID, like linked-itilobjects-section for instance.
…where the user selected multiple entities
… to help user and tests
Co-authored-by: Cédric Anne <cedric.anne@gmail.com>
1838001 to
cc3b7cb
Compare
| 'itemtypes': ['Ticket', 'Change', 'Problem'], | ||
| 'checkright': true, | ||
| 'entity_restrict': session('glpiactive_entity'), | ||
| 'entity_restrict': item.isRecursive() ? item.getEntityID() : call('getSonsOf', ['glpi_entities', item.getEntityID()]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem correct.
I've created two tickets: one in the root entity (A) and one in a sub entity (B).
From ticket A, I can link ticket B.
From ticket B, I can't link ticket A.
I think something like that would be enough:
| 'entity_restrict': item.isRecursive() ? item.getEntityID() : call('getSonsOf', ['glpi_entities', item.getEntityID()]), | |
| 'entity_restrict': session('glpiactiveentities'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was discussed here, and we decided to apply the current code : #21680 (comment) #21680 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not be able to link tickets from different entities. There is something to fix here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not be able to link tickets from different entities.
That is the whole point of the reported issue, if you don't want it to be possible then we can close this issue and this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tickets have no is_recursive field, so they are not supposed to be visible in child entities. Problem and changes can be recursive, so they have to be handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it work as expected, see my first comment of the thread.
| {% else %} | ||
| {{ _content }} | ||
| {% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even want to display the linked item title in this case?
It could expose confidential informations, maybe we should replace it by some kind of generic message (or show nothing at all).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Checklist before requesting a review
Description
Screenshots:
Linked item selector
Before
Screencast.from.2025-10-29.09-34-01.webm
After
Screencast.from.2025-10-29.09-19-31.webm