Skip to content
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

Fix merged ticket responses not being added to parent ticket #17124

Merged

Conversation

RomainLvr
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets !32514

Description

When merging a Child ticket C into a Parent ticket P, the following issues were observed:

  1. Merging Process:

    • The content of ticket C is successfully added to ticket P.
    • The status of ticket C is set to "deleted".
  2. Post-Merge Responses:

    • Responses posted to ticket C (now merged and deleted) are correctly added and visible.
    • Responses sent to ticket C are not added to ticket P. Instead, they remain visible in ticket C, which is no longer tracked due to its deleted status. However, they should be present in the parent ticket.

Resolution

To solve this problem, a post-add response step has been added, which detects parent tickets (if the ticket in question is a merged ticket) and then duplicates the tracking in the parent ticket.

@trasher
Copy link
Contributor

trasher commented May 16, 2024

Please add tests

src/Ticket.php Outdated Show resolved Hide resolved
src/Ticket.php Outdated Show resolved Hide resolved
@cedric-anne cedric-anne requested a review from orthagh May 21, 2024 07:55
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.

Seems OK (apart the missing sanitization), but I think it should target the main branch.

src/CommonITILTask.php Show resolved Hide resolved
src/Document_Item.php Show resolved Hide resolved
src/ITILFollowup.php Show resolved Hide resolved
@RomainLvr RomainLvr changed the base branch from 10.0/bugfixes to main May 21, 2024 08:47
src/CommonITILTask.php Outdated Show resolved Hide resolved
src/Document_Item.php Outdated Show resolved Hide resolved
src/ITILFollowup.php Outdated Show resolved Hide resolved
src/Ticket.php Outdated Show resolved Hide resolved
tests/functional/Ticket.php Outdated Show resolved Hide resolved
src/Document_Item.php Outdated Show resolved Hide resolved
@RomainLvr
Copy link
Contributor Author

@cedric-anne
I noticed that the sanitize() function is deprecated. I then came across this commit 440adc3. Is it necessary to sanitize the input?

@cedric-anne
Copy link
Member

@cedric-anne I noticed that the sanitize() function is deprecated. I then came across this commit 440adc3. Is it necessary to sanitize the input?

On main branch, it is not necessary to sanitize the input anymore. You can revert this change.

src/Document_Item.php Outdated Show resolved Hide resolved
src/CommonITILTask.php Outdated Show resolved Hide resolved
src/ITILFollowup.php Outdated Show resolved Hide resolved
@cedric-anne cedric-anne added this to the 11.0.0 milestone May 21, 2024
src/Ticket.php Outdated Show resolved Hide resolved
src/CommonITILTask.php Outdated Show resolved Hide resolved
@trasher
Copy link
Contributor

trasher commented May 22, 2024

Please rebase to solve conflicts

@cedric-anne cedric-anne force-pushed the fix/merge-child-ticket-responses branch from a1a6823 to 9a31e85 Compare May 22, 2024 07:03
@trasher trasher merged commit 6614c78 into glpi-project:main May 22, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants