Bug 40239 - Improve TT validation when saving notice
Summary: Improve TT validation when saving notice
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 31211
Blocks:
  Show dependency treegraph
 
Reported: 2025-06-25 11:54 UTC by Marion Durand
Modified: 2025-06-25 12:07 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marion Durand 2025-06-25 11:54:20 UTC
Bug 31211 add a validation system to detect error in notification template when saving, but some errors are not caught by this system:

For example, the following model will not generate any error or warning when saving, but it will completely (and silently) prevent sending the notification 
```
Hello [% borrower.date_due %]
```
(in general, when trying to access a sub-field/sub-object that doesn't exist)

Another example is a model looking like this :
```
Hello [% patron.surname %]
```
This notification is still sent, but the object patron doesn't exist and is not replaced. It would be great to test and warn the librarian if they are using invalid or non-available objects.
Comment 1 Marion Durand 2025-06-25 12:07:40 UTC
To reproduce : 
1- Go to Tools > Notification
2- In any notification template (but for example WELCOME is easy to generate from a patron page), enter the following model:
```
Hello,
[% borrower.date_due %]
```
or 
```
Hello [% patron.surname %]
```
3- Click on "Save and continue editing" and display the section (message transport type, for example email) you juste edited.
4- No error message has been added, the template looks valid
5- generate the notification.
With the first example, no notification is generated. With the second one, it is generated, but the object is not replaced.