Bug 38701

Summary: Fix HTML validity errors in invoice template
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: trivial    
Priority: P5 - low CC: david, emily.lamancusa, phil
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes some HTML markup errors on the Acquisitions > Invoices page - it now passes W3C HTML validation checks.
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 38701: Fix HTML validity errors in invoice template
Bug 38701: Fix HTML validity errors in invoice template
Bug 38701: Fix HTML validity errors in invoice template

Description Owen Leonard 2024-12-13 16:28:29 UTC
The invoice template ( Acquisitions -> Invoices -> Invoice details ) has some markup errors which should be fixed.
Comment 1 Owen Leonard 2024-12-13 16:36:45 UTC
Created attachment 175457 [details] [review]
Bug 38701: Fix HTML validity errors in invoice template

This patch makes some markup corrections to acqui/invoice.tt so that it
passes an HTML validity check.

- Moves incorrectly placed </td>
- Change <span> to <div> and remove invalid </br>
- Correct instances of "<th class="replacementprice"/>" (th cannot be
  self-closed)
- Add id attribute to inputs to correspond to existing labels
- Change "all_fund_dropdown" markup so that it validates but still works
  with the active/inactive fund display.

To test, apply the patch and go to Acquisitions -> Invoices. Perform an
invoice search which will return results. In the results click the
invoice number to view the invoice.

- Test the "show inactive" checkbox corresponding to the "Shipping fund"
  dropdown. Checking and unchecking it should work correctly to show and
  hide inactive funds.
- Run the page source through https://validator.w3.org and confirm that
  there are no errors coming from this template.

Sponsored-by: Athens County Public Libraries
Comment 2 Phil Ringnalda 2024-12-13 19:33:18 UTC
Created attachment 175469 [details] [review]
Bug 38701: Fix HTML validity errors in invoice template

This patch makes some markup corrections to acqui/invoice.tt so that it
passes an HTML validity check.

- Moves incorrectly placed </td>
- Change <span> to <div> and remove invalid </br>
- Correct instances of "<th class="replacementprice"/>" (th cannot be
  self-closed)
- Add id attribute to inputs to correspond to existing labels
- Change "all_fund_dropdown" markup so that it validates but still works
  with the active/inactive fund display.

To test, apply the patch and go to Acquisitions -> Invoices. Perform an
invoice search which will return results. In the results click the
invoice number to view the invoice.

- Test the "show inactive" checkbox corresponding to the "Shipping fund"
  dropdown. Checking and unchecking it should work correctly to show and
  hide inactive funds.
- Run the page source through https://validator.w3.org and confirm that
  there are no errors coming from this template.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 3 Phil Ringnalda 2024-12-13 19:33:51 UTC
TIL an inactive fund is any fund in an inactive budget, and, we have several severe validation errors that don't come from "this template." :)
Comment 4 Owen Leonard 2024-12-13 19:41:16 UTC
(In reply to Phil Ringnalda from comment #3)
> we have several
> severe validation errors that don't come from "this template."

Can you elaborate? I don't get any "severe" validations errors at all.
Comment 5 Phil Ringnalda 2024-12-13 20:42:55 UTC
Ah, I didn't look at what the duplicate IDs did, only that they were from includes. Yeah, having duplicate IDs in unused and unshown code isn't severe.

And it's been long enough since I last used a screen reader or had one installed that I don't actually know whether they now do a good job with <option value=""></option>, reading it as "No value selected" or something similar. Might be clear as a bell how to set a budget to the value "Not restricted to one library" or it might be impossible to tell when you have.
Comment 6 Phil Ringnalda 2024-12-13 20:54:04 UTC
Sigh. Never mind me, I carefully validated aqbudgets.tt after I created an inactive budget, and didn't validate invoice.tt at all.
Comment 7 Emily Lamancusa (emlam) 2024-12-19 20:37:46 UTC
Created attachment 175805 [details] [review]
Bug 38701: Fix HTML validity errors in invoice template

This patch makes some markup corrections to acqui/invoice.tt so that it
passes an HTML validity check.

- Moves incorrectly placed </td>
- Change <span> to <div> and remove invalid </br>
- Correct instances of "<th class="replacementprice"/>" (th cannot be
  self-closed)
- Add id attribute to inputs to correspond to existing labels
- Change "all_fund_dropdown" markup so that it validates but still works
  with the active/inactive fund display.

To test, apply the patch and go to Acquisitions -> Invoices. Perform an
invoice search which will return results. In the results click the
invoice number to view the invoice.

- Test the "show inactive" checkbox corresponding to the "Shipping fund"
  dropdown. Checking and unchecking it should work correctly to show and
  hide inactive funds.
- Run the page source through https://validator.w3.org and confirm that
  there are no errors coming from this template.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 8 Emily Lamancusa (emlam) 2024-12-19 20:38:20 UTC
Awesome, thanks Owen!
Comment 9 Katrin Fischer 2024-12-23 09:38:06 UTC
Pushed for 25.05!

Well done everyone, thank you!