Skip to content

Conversation

@f2cmb
Copy link
Contributor

@f2cmb f2cmb commented Oct 31, 2025

Description

Root Cause:
The JavaScript function itilfollowuptemplate_update() was unconditionally clearing the pending status when applying a followup template without a pending reason. Two issues:

  1. Line 304-305 always set checked = (data.pendingreasons_id > 0), unchecking the pending when template had no pending defined
  2. Lines 316-326 actively cleared user's pending choices if template didn't define a pending reason

Fix:
Removed the automatic clearing logic. Now the code only applies pending fields if the template explicitly defines them (data.pendingreasons_id > 0). If the template has no pending
defined, user's choices are preserved (do nothing).

image

@f2cmb
Copy link
Contributor Author

f2cmb commented Nov 3, 2025

I can see that the TinyMCE content is cleared when choosing a template. So still WIP.

@f2cmb
Copy link
Contributor Author

f2cmb commented Nov 3, 2025

Fixed content clearing : if the followup template has no content in it, TinyMCE is not cleared (l.289 - 291), assuming the user would add his own content w/o an "empty" template.

@f2cmb f2cmb marked this pull request as ready for review November 3, 2025 14:03
@cedric-anne cedric-anne added this to the 11.0.2 milestone Nov 3, 2025
@cedric-anne cedric-anne added the bug label Nov 3, 2025
Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

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

Looks good but I guess the same should be done on task templates then?

Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

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

See previous comment

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

Please check if the same fix must be applied to task form.

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.

GLPI 11 : pending feature cleared when applying a follow-up template without a pending reason

4 participants