Skip to content

Fix (TicketTask) empty task duration dropdown no longer overrides the planned end date#24811

Open
Herafia wants to merge 2 commits into
glpi-project:11.0/bugfixesfrom
Herafia:fix/task-empty-duration-overrides-end-date
Open

Fix (TicketTask) empty task duration dropdown no longer overrides the planned end date#24811
Herafia wants to merge 2 commits into
glpi-project:11.0/bugfixesfrom
Herafia:fix/task-empty-duration-overrides-end-date

Conversation

@Herafia

@Herafia Herafia commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • 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

  • It fixes !45088
  • Here is a brief description of what this PR does

The task form contains two duration fields that are submitted at the same time during saving:

The duration drop-down list: actiontime field
The schedule
Upon saving, handleTaskDuration determines which one takes precedence. Its rule was:

If the duration from the drop-down list differs from the one saved, then it takes precedence, and it recalculates the end date as start date + duration.

The duration drop-down list only offers fixed increments (1 to 9 minutes, then in 5-minute increments, then in hours, etc.). If the task has a duration that does not match any of these increments (for example, 12 minutes), the list cannot display it → it defaults to the empty option “-----,” which sends the value 0.

Upon saving:

list duration (0) ≠ saved duration (e.g., 720 s) → the list “wins”
therefore end = start + 0 = start
therefore start = end → validation fails → ERROR

Now: we only allow the “duration” list to override the end date if an actual duration (> 0) has been selected.

Screenshots (if appropriate):

Capture d’écran du 2026-07-08 14-32-11 Capture d’écran du 2026-07-08 14-33-36

@Herafia Herafia requested review from Rom1-B and stonebuzz July 8, 2026 13:48
@cedric-anne cedric-anne added this to the 11.0.9 milestone Jul 9, 2026
@cedric-anne cedric-anne added the bug label Jul 9, 2026
Comment thread src/CommonITILTask.php Outdated

@stonebuzz stonebuzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with requested change

@trasher

trasher commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Also, please rebase ti update CI conf

Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
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.

5 participants