Summary: | Check slips and notices for valid Template Toolkit and report errors | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Tools | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | normal | ||
Priority: | P5 - low | CC: | lucas, martin.renvoize, sally.healey |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 31373, 32442 | ||
Attachments: |
Bug 31211: Check slips and notices for valid Template Toolkit and report errors
Bug 31211: Check slips and notices for valid Template Toolkit and report errors Bug 31211: Check slips and notices for valid Template Toolkit and report errors Bug 31211: (QA follow-up) Add class to new list element for error |
Description
Kyle M Hall (khall)
2022-07-21 15:06:03 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 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> 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. 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. 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> 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> (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! Pushed to master for 22.11. Nice work everyone, thanks! 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 Skipping this one for 22.05.x, at least until we have Bug 31373 |