8000
Skip to content

fix(itil): Linked itilobject should return the child entities itilobject - #21680

Closed
froozeify wants to merge 13 commits into
glpi-project:11.0/bugfixesfrom
froozeify:11.0/21545-linked-itil-object-cant-see-child-active-entity-items
Closed

fix(itil): Linked itilobject should return the child entities itilobject#21680
froozeify wants to merge 13 commits into
glpi-project:11.0/bugfixesfrom
froozeify:11.0/21545-linked-itil-object-cant-see-child-active-entity-items

Conversation

@froozeify
@froozeify froozeify commented Oct 29, 2025
Copy link
Copy Markdown
Member

Checklist before requesting a review

  • 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

Screenshots:

Linked item selector

  • Before

    Screencast.from.2025-10-29.09-34-01.webm
  • After

    Screencast.from.2025-10-29.09-19-31.webm

@froozeify
froozeify force-pushed the 11.0/21545-linked-itil-object-cant-see-child-active-entity-items branch from ab4bfe5 to 4f61140 Compare October 29, 2025 08:38
@froozeify
froozeify marked this pull request as ready for review October 29, 2025 15:00
Comment thread templates/components/itilobject/linked_itilobjects.html.twig Outdated
@froozeify
froozeify requested a review from trasher October 30, 2025 08:39
@cedric-anne cedric-anne added this to the 11.0.2 milestone Oct 30, 2025
@cedric-anne cedric-anne modified the milestones: 11.0.2, 11.0.3 Nov 4, 2025
Comment thread templates/components/itilobject/linked_itilobjects.html.twig Outdated
@froozeify
froozeify force-pushed the 11.0/21545-linked-itil-object-cant-see-child-active-entity-items branch from ed8a6e6 to ac08664 Compare November 5, 2025 08:26
@froozeify
froozeify requested a review from cedric-anne November 5, 2025 09:51
Comment thread templates/components/itilobject/linked_itilobjects.html.twig Outdated
Comment thread templates/layout/parts/profile_selector_form.html.twig Outdated
Comment thread templates/components/itilobject/fields_panel.html.twig Outdated
Comment thread templates/components/itilobject/linked_itilobjects.html.twig Outdated
@cedric-anne cedric-anne left a comment
Copy link
Copy Markdown
Member

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.

@froozeify
froozeify force-pushed the 11.0/21545-linked-itil-object-cant-see-child-active-entity-items branch from 1838001 to cc3b7cb Compare November 17, 2025 08:38
Comment thread templates/components/itilobject/fields_panel.html.twig
'itemtypes': ['Ticket', 'Change', 'Problem'],
'checkright': true,
'entity_restrict': session('glpiactive_entity'),
'entity_restrict': item.isRecursive() ? item.getEntityID() : call('getSonsOf', ['glpi_entities', item.getEntityID()]),
Copy link
Copy Markdown
Member

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:

Suggested change
'entity_restrict': item.isRecursive() ? item.getEntityID() : call('getSonsOf', ['glpi_entities', item.getEntityID()]),
'entity_restrict': session('glpiactiveentities'),

Copy link
Copy Markdown
Member Author

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)

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Comment on lines +65 to +67
{% else %}
{{ _content }}
{% endif %}
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It can be useful for the user to know that there is another itil object linked to it.

But yes maybe we could display a generic message like {{ linked['itemtype']|itemtype_name }} or even a fake random text with a blur over it so visually the user know he don't have access.

Image

@cedric-anne
Copy link
Copy Markdown
Member

Replaced by #22851

@cedric-anne cedric-anne closed this Feb 2, 2026
@cedric-anne cedric-anne removed this from the 11.0.6 milestone Feb 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been is closed and has been automatically locked. Please open a new issue with all requested information for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with adding Linked assistance object ( ticket )

4 participants

0