Bug 31211 - Check slips and notices for valid Template Toolkit and report errors
Summary: Check slips and notices for valid Template Toolkit and report errors
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 31373 32442
  Show dependency treegraph
 
Reported: 2022-07-21 15:06 UTC by Kyle M Hall
Modified: 2023-06-08 22:32 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 31211: Check slips and notices for valid Template Toolkit and report errors (4.56 KB, patch)
2022-07-21 15:13 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 31211: Check slips and notices for valid Template Toolkit and report errors (4.62 KB, patch)
2022-07-21 15:34 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 31211: Check slips and notices for valid Template Toolkit and report errors (4.68 KB, patch)
2022-07-25 22:29 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31211: (QA follow-up) Add class to new list element for error (1.41 KB, patch)
2022-07-25 22:29 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2022-07-21 15:06:03 UTC
It would be useful for Koha to run a basic TT validation test and report back errors. That way if somebody misses an END tag or something of that nature, it will be easy to find and fix.
Comment 1 Kyle M Hall 2022-07-21 15:13:36 UTC
Created attachment 137984 [details] [review]
Bug 31211: Check slips and notices for valid Template Toolkit and report errors

It would be useful for Koha to run a basic TT validation test and report back errors.
That way if somebody misses an END tag or something of that nature, it will be easy to find and fix.

Test Plan:
1) Apply this patch
2) Edit a notice, change the content to simply "[% END %]"
   or some other invalid Template Toolkit
3) Choose "Save and continue editing"
4) Note the new "Template Toolkit error" field that displays the error
   message
Comment 2 Biblibre Sandboxes 2022-07-21 15:34:14 UTC
Created attachment 137985 [details] [review]
Bug 31211: Check slips and notices for valid Template Toolkit and report errors

It would be useful for Koha to run a basic TT validation test and report back errors.
That way if somebody misses an END tag or something of that nature, it will be easy to find and fix.

Test Plan:
1) Apply this patch
2) Edit a notice, change the content to simply "[% END %]"
   or some other invalid Template Toolkit
3) Choose "Save and continue editing"
4) Note the new "Template Toolkit error" field that displays the error
   message

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2022-07-21 15:35:43 UTC
I really like this - I tested with a few different errors, including missing and duplicated characters, and it works really well.  Thanks for the patch, signed off.
Comment 4 Katrin Fischer 2022-07-25 22:28:22 UTC
As I was recently suffering a lot from "Internal server error" on testing notices, I really like the idea of this.

Of course, the errors are English only and quite technical. And maybe the error could stand out a bit more. 

I have added a CSS class to the new list element in a follow-up, so libraries will be able to do additional styling or even hide it.
Comment 5 Katrin Fischer 2022-07-25 22:29:30 UTC
Created attachment 138107 [details] [review]
Bug 31211: Check slips and notices for valid Template Toolkit and report errors

It would be useful for Koha to run a basic TT validation test and report back errors.
That way if somebody misses an END tag or something of that nature, it will be easy to find and fix.

Test Plan:
1) Apply this patch
2) Edit a notice, change the content to simply "[% END %]"
   or some other invalid Template Toolkit
3) Choose "Save and continue editing"
4) Note the new "Template Toolkit error" field that displays the error
   message

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2022-07-25 22:29:34 UTC
Created attachment 138108 [details] [review]
Bug 31211: (QA follow-up) Add class to new list element for error

To allow additional styling the class template_toolkit_error was
added to the list element.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Kyle M Hall 2022-07-26 10:53:36 UTC
(In reply to Katrin Fischer from comment #6)
> Created attachment 138108 [details] [review] [review]
> Bug 31211: (QA follow-up) Add class to new list element for error
> 
> To allow additional styling the class template_toolkit_error was
> added to the list element.
> 
> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Good idea! Thanks Katrin!
Comment 8 Tomás Cohen Arazi 2022-07-26 12:34:38 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 9 Martin Renvoize 2022-08-16 15:44:33 UTC
Nice feature.. just spotted it when adding a new template..

It needs a follow-up.. we're not accounting for the path additions that allow for includes to be used ;P
Comment 10 Lucas Gass 2022-09-02 20:14:31 UTC
Skipping this one for 22.05.x, at least until we have Bug 31373