Bugzilla – Attachment 162426 Details for
Bug 36099
JS error in console on non-existent biblio record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty
Bug-36099-count-and-holdcount-template-vars-into-J.patch (text/plain), 1.47 KB, created by
Pedro Amorim
on 2024-02-26 10:04:27 UTC
(
hide
)
Description:
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-02-26 10:04:27 UTC
Size:
1.47 KB
patch
obsolete
>From b55e8b8ba761a24945e6a0cf3991dbc62e4cfe2a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 26 Feb 2024 10:03:22 +0000 >Subject: [PATCH] Bug 36099: count and holdcount template vars into JS vars > should default to 0 if empty > >Visit: >http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4321 >Notice you have 2 console errors: >1) Uncaught SyntaxError: Unexpected token ';' >2) Uncaught ReferenceError: biblionumber is not defined > >Apply patch. Repeat. Notice no error shows. >Visit an existing biblionumber. Confirm all is well. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >index 3ab04f9af12..fc88b79abff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >@@ -3,8 +3,8 @@ > <script> > /* Some required variables from the template */ > var biblionumber = [% biblionumber | html %]; >- var count = [% count | html %]; >- var holdcount = [% holdcount | html %]; >+ var count = [% count || 0 | html %]; >+ var holdcount = [% holdcount || 0 | html %]; > [% SET orders = biblio.orders %] > [% SET current = Context.Scalar(orders, "filter_by_current") %] > [% SET cancelled = Context.Scalar(orders, "filter_by_cancelled") %] >-- >2.30.2
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 36099
:
162426
|
162431
|
162577