[Bug 42283] New: Tidy all script tags - cataloguing
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Bug ID: 42283 Summary: Tidy all script tags - cataloguing 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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 watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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=42283 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196785&action=edit Bug 42283: Tidy all script tags - cataloguing 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 cataloguing module. The 3 main changes are in the following files: * addbooks.tt * additem.tt * concerns.tt There are non-trivial changes in concerns.tt. You need to create several authorised values for TICKET_STATUS, turn on CatalogConcerns and OpacCatalogConcerns, create several concerns and go to /cgi-bin/koha/cataloguing/concerns.pl Confirm that the filters are working correctly Note that cataloguing/addbiblio.tt is on a separate bug (bug 42284) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196786 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196786&action=edit Bug 42283: Tidy all script tags - cataloguing (auto tidy) Patch from commit f8e8151 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196785|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=42283 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196818&action=edit Bug 42283: Tidy all script tags - cataloguing 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 cataloguing module. The 3 main changes are in the following files: * addbooks.tt * additem.tt * concerns.tt There are non-trivial changes in concerns.tt. You need to create several authorised values for TICKET_STATUS, turn on CatalogConcerns and OpacCatalogConcerns, create several concerns and go to /cgi-bin/koha/cataloguing/concerns.pl Confirm that the filters are working correctly Note that cataloguing/addbiblio.tt is on a separate bug (bug 42284) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196786|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=42283 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 196819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196819&action=edit Bug 42283: Tidy all script tags - cataloguing (auto tidy) Patch from commit 6c21043 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196818|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=42283 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197553 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197553&action=edit Bug 42283: Tidy all script tags - cataloguing 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 cataloguing module. The 3 main changes are in the following files: * addbooks.tt * additem.tt * concerns.tt There are non-trivial changes in concerns.tt. You need to create several authorised values for TICKET_STATUS, turn on CatalogConcerns and OpacCatalogConcerns, create several concerns and go to /cgi-bin/koha/cataloguing/concerns.pl Confirm that the filters are working correctly Note that cataloguing/addbiblio.tt is on a separate bug (bug 42284) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196819|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=42283 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197554 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197554&action=edit Bug 42283: Tidy all script tags - cataloguing (auto tidy) Patch from commit f19d96a -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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=42283 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197553|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=42283 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197554|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=42283 --- Comment #7 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197580&action=edit Bug 42283: Tidy all script tags - cataloguing 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 cataloguing module. The 3 main changes are in the following files: * addbooks.tt * additem.tt * concerns.tt There are non-trivial changes in concerns.tt. You need to create several authorised values for TICKET_STATUS, turn on CatalogConcerns and OpacCatalogConcerns, create several concerns and go to /cgi-bin/koha/cataloguing/concerns.pl Confirm that the filters are working correctly Note that cataloguing/addbiblio.tt is on a separate bug (bug 42284) 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=42283 --- Comment #8 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197581 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197581&action=edit Bug 42283: Tidy all script tags - cataloguing (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=42283 --- Comment #9 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197582&action=edit Bug 42283: (follow-up) Fix checkbox selector in concerns status filter Porting the per-status click handler out of the TT loop dropped the "hide_" prefix on the checkbox selectors: - the `is(":checked")` test looked at `#<av>` instead of `#hide_<av>`, so the branch that removes the filter never fired - the toggle line read `!$("#hide${av}")` (no underscore) before writing `#hide_<av>`, so the checkbox state was always forced to true and further clicks stopped toggling Restore `#hide_${av}` in both places so the filter toggles match the original TT-rendered selectors (IDs `hide_<av>` on the hidden checkboxes). To test: - Set up TICKET_STATUS authorised values and enable CatalogConcerns and OpacCatalogConcerns. - Create concerns in multiple statuses, open /cgi-bin/koha/cataloguing/concerns.pl. - Click a "Filter <status>" link: rows with that status disappear. - Click the same link again: it flips back to "Include <status>" and rows reappear. Repeat across several statuses. 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=42283 --- Comment #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 197583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197583&action=edit Bug 42283: (follow-up) URI-encode z3950 search params in GetZ3950Terms The original template rendered each Z39.50 search param with the "| uri" TT filter, so the generated query string was safe for values containing spaces, ampersands or other reserved characters. The JS port concatenates the raw values, producing a broken query string when any search field (title, author, subject, etc.) is not already URL-safe. Wrap name and value in encodeURIComponent to restore the original behaviour. To test: - Import or create a biblio whose title or author includes a space and an ampersand (e.g. "Q & A: Practical tests"). - From the cataloging search results, trigger the Z39.50 search for that record. - Confirm the request URL includes correctly encoded parameters (space as %20, & as %26) and that the Z39.50 results load. 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=42283 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=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42651 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42651 [Bug 42651] When CatalogConcerns is enabled the concern table is not loaded on detail.pl and a Uncaught TypeError is thrown -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Bug 42283 depends on bug 42651, which changed state. Bug 42651 Summary: When CatalogConcerns is enabled the concern table is not loaded on detail.pl and a Uncaught TypeError is thrown https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42651 What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197580|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=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197581|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=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197582|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=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197583|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=42283 --- Comment #11 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199360&action=edit Bug 42283: Tidy all script tags - cataloguing 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 cataloguing module. The 3 main changes are in the following files: * addbooks.tt * additem.tt * concerns.tt There are non-trivial changes in concerns.tt. You need to create several authorised values for TICKET_STATUS, turn on CatalogConcerns and OpacCatalogConcerns, create several concerns and go to /cgi-bin/koha/cataloguing/concerns.pl Confirm that the filters are working correctly Note that cataloguing/addbiblio.tt is on a separate bug (bug 42284) 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=42283 --- Comment #12 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199361 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199361&action=edit Bug 42283: Tidy all script tags - cataloguing (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=42283 --- Comment #13 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199362 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199362&action=edit Bug 42283: (follow-up) Fix checkbox selector in concerns status filter Porting the per-status click handler out of the TT loop dropped the "hide_" prefix on the checkbox selectors: - the `is(":checked")` test looked at `#<av>` instead of `#hide_<av>`, so the branch that removes the filter never fired - the toggle line read `!$("#hide${av}")` (no underscore) before writing `#hide_<av>`, so the checkbox state was always forced to true and further clicks stopped toggling Restore `#hide_${av}` in both places so the filter toggles match the original TT-rendered selectors (IDs `hide_<av>` on the hidden checkboxes). To test: - Set up TICKET_STATUS authorised values and enable CatalogConcerns and OpacCatalogConcerns. - Create concerns in multiple statuses, open /cgi-bin/koha/cataloguing/concerns.pl. - Click a "Filter <status>" link: rows with that status disappear. - Click the same link again: it flips back to "Include <status>" and rows reappear. Repeat across several statuses. 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=42283 --- Comment #14 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199363 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199363&action=edit Bug 42283: (follow-up) URI-encode z3950 search params in GetZ3950Terms The original template rendered each Z39.50 search param with the "| uri" TT filter, so the generated query string was safe for values containing spaces, ampersands or other reserved characters. The JS port concatenates the raw values, producing a broken query string when any search field (title, author, subject, etc.) is not already URL-safe. Wrap name and value in encodeURIComponent to restore the original behaviour. To test: - Import or create a biblio whose title or author includes a space and an ampersand (e.g. "Q & A: Practical tests"). - From the cataloging search results, trigger the Z39.50 search for that record. - Confirm the request URL includes correctly encoded parameters (space as %20, & as %26) and that the Z39.50 results load. 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=42283 --- Comment #15 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 199364 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199364&action=edit Bug 42283: (QA follow-up) Rename table_settings in detail.tt Fixes the issue of duplicate usage of table_settings in detail.pl (see Bug 42651). The table on catalogue detail was not loaded initially and an Uncaught TypeError was thrown. Changes the icon on concerns resolved filter to suit other filters set via AV TICKET_STATUS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- Thanks for the review and the follow-up, Jan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38196 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38196 [Bug 38196] Filter out concerns by specific status does not include concern without status -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199364|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=42283 --- Comment #17 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 199808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199808&action=edit Bug 42283: (QA follow-up) Change icons Changes the icon on concerns resolved filter to suit other filters set via AV TICKET_STATUS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42282 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jan Kissig from comment #15)
Created attachment 199364 [details] [review] Bug 42283: (QA follow-up) Rename table_settings in detail.tt
Fixes the issue of duplicate usage of table_settings in detail.pl (see Bug 42651). The table on catalogue detail was not loaded initially and an Uncaught TypeError was thrown. Changes the icon on concerns resolved filter to suit other filters set via AV TICKET_STATUS.
I've adjusted this patch, the variable has been renamed already on bug 42282. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42282 [Bug 42282] Tidy all script tags - catalogue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 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=42283 --- Comment #19 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=42283 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |lucas@bywatersolutions.com Status|Pushed to main |RESOLVED --- Comment #20 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42283 Bug 42283 depends on bug 42282, which changed state. Bug 42282 Summary: Tidy all script tags - catalogue https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42282 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org