Skip to content

Conversation

@froozeify
Copy link
Member

@froozeify froozeify commented Oct 29, 2025

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
@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
@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
Copy link
Member

@cedric-anne cedric-anne left a 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.

@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
'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
Contributor

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
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
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
Contributor

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
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
Contributor

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
Contributor

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
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 cedric-anne modified the milestones: 11.0.3, 11.0.4 Nov 26, 2025
@cedric-anne cedric-anne modified the milestones: 11.0.4, 11.0.5 Dec 4, 2025
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.

Problem with adding Linked assistance object ( ticket )

4 participants