fix(itil): Linked itilobject should return the child entities itilobject - #21680
Conversation
ab4bfe5 to
4f61140
Compare
ed8a6e6 to
ac08664
Compare
There was a problem hiding this comment.
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.
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.
It was discussed here, and we decided to apply the current code : #21680 (comment) #21680 (comment)
There was a problem hiding this comment.
You should not be able to link tickets from different entities. There is something to fix here.
There was a problem hiding this comment.
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.
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.
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.
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.
|
Replaced by #22851 |
|
This PR has been is closed and has been automatically locked. Please open a new issue with all requested information for related bugs. |
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