Bugzilla – Attachment 171954 Details for
Bug 37998
Tabs and backslashes in the data break item search display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37998: Tabs and backslashes in the data break item search display
Bug-37998-Tabs-and-backslashes-in-the-data-break-i.patch (text/plain), 5.99 KB, created by
Janusz Kaczmarek
on 2024-09-24 21:57:27 UTC
(
hide
)
Description:
Bug 37998: Tabs and backslashes in the data break item search display
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-09-24 21:57:27 UTC
Size:
5.99 KB
patch
obsolete
>From c4aec1626258c49c014de6eec8997ee75c864d20 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 24 Sep 2024 21:05:32 +0000 >Subject: [PATCH] Bug 37998: Tabs and backslashes in the data break item search > display > >If the item data (e.g. callnumber) contains a tab or backslash OR the >title part contains a backslash, the DataTable displaying the item >search results stops throwing an error modal "Something went wrong when >loading the table. 200: OK." and a JS console log: "DataTables warning: >table id=results - Invalid JSON response. For more information about >this error, please see http://datatables.net/tn/1". > >Test plan: >========== > >1. Make an item search w/o any parameters. >2. From the first result page choose a record and modify the title (245 $a) > to contain " \ " string. Repeat the item search. You should see a modal > "Something went wrong when loading the table. 200: OK.". >3. Remove the " \ " from the title. Verify that the problem no longer occurs. >4. In the same record, insert the string " \ " or a tab (copied from a text > editor) into item data (itemcallnumber, enumchron, barcode etc.). >5. Repeat the item search. You should see again a modal "Something went wrong > when loading the table. 200: OK.". >6. Apply the patch; restart_all. >7. Repeat p. 2, 3, 4, and 5. Verify, that the problem is solved. > >Sponsored-by: Ignatianum University in Cracow >--- > .../intranet-tmpl/prog/en/includes/biblio-title.inc | 11 ++++++----- > .../en/includes/catalogue/itemsearch_item.json.inc | 12 ++++++------ > 2 files changed, 12 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >index 66ebc8527a..694f569f57 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-title.inc >@@ -1,3 +1,4 @@ >+[%- USE To -%] > [%- IF link && ! biblio %][% link = 0 %][% END %] > [%- IF ( link ) -%] > <a href="[%- PROCESS biblio_a_href biblionumber => biblio.biblionumber -%]" class="title"> >@@ -8,23 +9,23 @@ > [%- ELSIF !biblio.title -%] > <span class="biblio-no-title">No title</span> > [%- ELSE -%] >- <span class="biblio-title">[% biblio.title | html %]</span> >+ <span class="biblio-title">[% biblio.title | html | $To %]</span> > [%- END -%] > [%- IF ( biblio.medium ) -%] >- <span class="biblio-medium">[%- biblio.medium | html -%]</span> >+ <span class="biblio-medium">[%- biblio.medium | html | $To -%]</span> > [%- END -%] > [%- FOREACH subtitle IN biblio.subtitle.split(' \\| ') -%][%- IF Koha.Preference('marcflavour')=='UNIMARC' -%],[%- END -%] >- <span class="subtitle">[%- subtitle | html -%]</span> >+ <span class="subtitle">[%- subtitle | html | $To -%]</span> > [%- END -%] > [%- part_numbers = biblio.part_number.split(' \\| ') -%] > [%- part_names = biblio.part_name.split(' \\| ') -%] > [%- i = 0 -%] > [%- WHILE ( part_numbers.$i.defined || part_names.$i.defined ) -%] > [%- IF ( part_numbers.$i.defined ) -%] >- <span class="part-number">[%- part_numbers.$i | html -%]</span> >+ <span class="part-number">[%- part_numbers.$i | html | $To -%]</span> > [%- END -%] > [%- IF ( part_names.$i.defined ) -%] >- <span class="part-name">[%- part_names.$i | html -%]</span> >+ <span class="part-name">[%- part_names.$i | html | $To -%]</span> > [%- END -%] > [%- i = i + 1 -%] > [%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >index d1eda11819..e78a231ce1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc >@@ -13,20 +13,20 @@ > "[% FILTER escape_quotes ~%] > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]" title="Go to record detail page">[% INCLUDE 'biblio-title.inc' | trim | collapse %]</a>[% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %] by[% END %] [% biblio.author | html %] > [%~ END %]", >- "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", >+ "[% (biblioitem.publicationyear || biblio.copyrightdate) | html | $To %]", > "[% biblioitem.publishercode | html | $To %]", >- "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]", >+ "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html | $To %]", > "[% FILTER escape_quotes ~%] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]#item[% item.itemnumber | uri %]" title="Go to item details">[% item.barcode | html %]</a> >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]#item[% item.itemnumber | uri %]" title="Go to item details">[% item.barcode | html | $To %]</a> > [%~ END %]", > "[% item.itemnumber | html %]", >- "[% item.enumchron | html %]", >- "[% item.itemcallnumber | html %]", >+ "[% item.enumchron | html | $To %]", >+ "[% item.itemcallnumber | html | $To %]", > "[% Branches.GetName(item.homebranch) | html %]", > "[% Branches.GetName(item.holdingbranch) | html %]", > "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | html %]", > "[% ItemTypes.GetDescription(item.itype) | html %]", >- "[% item.stocknumber | html %]", >+ "[% item.stocknumber | html | $To %]", > "[% AuthorisedValues.GetDescriptionByKohaField( frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]", > "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]", > "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | html %]", >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37998
:
171954
|
171955
|
174127
|
174149