[Bug 42278] New: Tidy all script tags - circ
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Bug ID: 42278 Summary: Tidy all script tags - circ Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org Blocks: 42094 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42094 [Bug 42094] Tidy all script tags (except value_builder) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196775&action=edit Bug 42278: Tidy all script tags - circ In order to tidy all the script tags of the .tt files we isolate the interpolation of Template::Toolkit variables in a separate script tag. This patch focuses on the circulation module. The 4 main changes are in the following files: * circulation.tt As expected this one is messy to test, we need to look at the diff and make sure the different features linked with the variables moved at still working correctly (yes, it's vague!) * circulation_batch_checkouts.tt On the batch checkout table the due date hidden input should have the value of the return date high demand items. * overdue.tt On the overdue report view, the "Return claims" column must be hidden if ClaimReturnedLostValue is not set. * transfers_to_send.tt The transfers to send view should show all libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196776&action=edit Bug 42278: Tidy all script tags - circ (auto tidy) Patch from commit 69500f4 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196775|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197044 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197044&action=edit Bug 42278: Tidy all script tags - circ In order to tidy all the script tags of the .tt files we isolate the interpolation of Template::Toolkit variables in a separate script tag. This patch focuses on the circulation module. The 4 main changes are in the following files: * circulation.tt As expected this one is messy to test, we need to look at the diff and make sure the different features linked with the variables moved at still working correctly (yes, it's vague!) * circulation_batch_checkouts.tt On the batch checkout table the due date hidden input should have the value of the return date high demand items. * overdue.tt On the overdue report view, the "Return claims" column must be hidden if ClaimReturnedLostValue is not set. * transfers_to_send.tt The transfers to send view should show all libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196776|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197045 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197045&action=edit Bug 42278: Tidy all script tags - circ (auto tidy) Patch from commit b5a33a5 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41653 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41653 [Bug 41653] Stores for permissions and sysprefs should be under the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197044|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197045|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #5 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197563&action=edit Bug 42278: Tidy all script tags - circ In order to tidy all the script tags of the .tt files we isolate the interpolation of Template::Toolkit variables in a separate script tag. This patch focuses on the circulation module. The 4 main changes are in the following files: * circulation.tt As expected this one is messy to test, we need to look at the diff and make sure the different features linked with the variables moved at still working correctly (yes, it's vague!) * circulation_batch_checkouts.tt On the batch checkout table the due date hidden input should have the value of the return date high demand items. * overdue.tt On the overdue report view, the "Return claims" column must be hidden if ClaimReturnedLostValue is not set. * transfers_to_send.tt The transfers to send view should show all libraries Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197564 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197564&action=edit Bug 42278: Tidy all script tags - circ (auto tidy) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #7 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197565 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197565&action=edit Bug 42278: (follow-up) Restore findborrower autofocus when no patron loaded The JS port inverted the original UNLESS condition, so the patron search field was focused only after a patron was already selected. Flip back to !borrowernumber. To test: - /cgi-bin/koha/circ/circulation.pl with no patron → cursor in findborrower - Select patron, reload → no focus jump Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197566&action=edit Bug 42278: (follow-up) Guard bare-RHS TT interpolations Several unquoted const assignments rendered to `const X = ;` when their TT expression was empty (patron.borrowernumber without a patron, CAN_user_circulate_manage_bookings absent, or the AlwaysLoadCheckoutsTable syspref unset). The parser aborted the whole script block, so has_patron, AlwaysLoadCheckoutsTable, etc. were never defined and later scripts failed with ReferenceError. Add TT fallbacks so the RHS is always a valid JS literal. To test: - /cgi-bin/koha/circ/circulation.pl with no patron → no console errors - Search a patron, check out an item → still works Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |bibliothek@th-wildau.de |y.org | CC| |bibliothek@th-wildau.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197563|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197564|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197565|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197566|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #9 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199713 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199713&action=edit Bug 42278: Tidy all script tags - circ In order to tidy all the script tags of the .tt files we isolate the interpolation of Template::Toolkit variables in a separate script tag. This patch focuses on the circulation module. The 4 main changes are in the following files: * circulation.tt As expected this one is messy to test, we need to look at the diff and make sure the different features linked with the variables moved at still working correctly (yes, it's vague!) * circulation_batch_checkouts.tt On the batch checkout table the due date hidden input should have the value of the return date high demand items. * overdue.tt On the overdue report view, the "Return claims" column must be hidden if ClaimReturnedLostValue is not set. * transfers_to_send.tt The transfers to send view should show all libraries Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #10 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199714&action=edit Bug 42278: Tidy all script tags - circ (auto tidy) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #11 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199715&action=edit Bug 42278: (follow-up) Restore findborrower autofocus when no patron loaded The JS port inverted the original UNLESS condition, so the patron search field was focused only after a patron was already selected. Flip back to !borrowernumber. To test: - /cgi-bin/koha/circ/circulation.pl with no patron → cursor in findborrower - Select patron, reload → no focus jump Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #12 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199716&action=edit Bug 42278: (follow-up) Guard bare-RHS TT interpolations Several unquoted const assignments rendered to `const X = ;` when their TT expression was empty (patron.borrowernumber without a patron, CAN_user_circulate_manage_bookings absent, or the AlwaysLoadCheckoutsTable syspref unset). The parser aborted the whole script block, so has_patron, AlwaysLoadCheckoutsTable, etc. were never defined and later scripts failed with ReferenceError. Add TT fallbacks so the RHS is always a valid JS literal. To test: - /cgi-bin/koha/circ/circulation.pl with no patron → no console errors - Search a patron, check out an item → still works Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #13 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199717&action=edit Bug 42278: (QA follow-up): Split JS to separate TT and tidy This puts ArticleRequestsSupportedFormats in a separate script tag. Auto tidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #14 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199718&action=edit Bug 42278: (QA follow-up) Fix Uncaught TypeError in request-article This fixes an Uncaught TypeError when searching for a patron and the search only returns a single patron. To test: a) go to /cgi-bin/koha/circ/request-article.pl?biblionumber=262 b) ienable dev tools console c) enter 'acev' and click Search d) The following error appears: Uncaught TypeError: can't access property "on", patrons_table is undefined e) apply patch and redo a) to c). The error is not thrown. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #15 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199719&action=edit Bug 42278: (QA follow-up) Fix HIGHHOLDS to JSON serialisation Using Koha::Template::Plugin::To to serialize HIGHHOLDS to JSON led to the following error: Template process failed: undef error - encountered object '2026-05-31T23:59:00', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /kohadevbox/koha/Koha/Template/Plugin/To.pm line 32. This patch fixes the handling of HIGHHOLDS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- Thanks a lot for the follow-ups, Paul and Jan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #17 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 201330 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201330&action=edit Bug 42278: Fix JS error Uncaught SyntaxError: redeclaration of non-configurable global property ClaimReturnedLostValue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> --- Caught by a Cypress failure: 17:28:31 Running: flatpickr_spec.ts (9 of 61) 17:28:31 <?xml version="1.0" encoding="UTF-8"?> 17:28:31 <testsuites name="Mocha Tests" time="3.147" tests="1" failures="1"> 17:28:31 <testsuite name="Root Suite" timestamp="2026-06-30T15:27:29" tests="0" file="t/cypress/integration/flatpickr_spec.ts" time="0.000" failures="0"> 17:28:31 </testsuite> 17:28:31 <testsuite name="Flatpickr" timestamp="2026-06-30T15:27:29" tests="1" time="3.042" failures="1"> 17:28:31 <testcase name="Flatpickr 'Clear filter' works correctly" time="0.000" classname="'Clear filter' works correctly"> 17:28:31 <failure message="The following error originated from your application code, not from Cypress. 17:28:31 17:28:31 > Identifier 'ClaimReturnedLostValue' has already been declared -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | CC| |pedro.amorim@openfifth.co.u | |k --- Comment #20 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Follow-up pushed. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42278 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com Resolution|--- |FIXED --- Comment #21 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement will not be backported to 26.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org