Bug 36099 - JS error in console on non-existent biblio record
Summary: JS error in console on non-existent biblio record
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Pedro Amorim
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 08:38 UTC by Jonathan Druart
Modified: 2024-03-19 15:10 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.04,23.05.10
Circulation function:


Attachments
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty (1.47 KB, patch)
2024-02-26 10:04 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty (1.52 KB, patch)
2024-02-26 11:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty (1.60 KB, patch)
2024-02-29 09:06 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-02-15 08:38:39 UTC
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=4321

"Uncaught ReferenceError: biblionumber is not defined"

Coming from this line: 
  browser = KOHA.browser('', parseInt(biblionumber, 10));
Comment 1 Pedro Amorim 2024-02-26 10:04:27 UTC
Created attachment 162426 [details] [review]
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.
Comment 2 Owen Leonard 2024-02-26 11:54:30 UTC
Created attachment 162431 [details] [review]
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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Jonathan Druart 2024-02-29 09:06:41 UTC
Created attachment 162577 [details] [review]
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.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Katrin Fischer 2024-03-07 14:04:32 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 5 Fridolin Somers 2024-03-11 09:24:49 UTC
Pushed to 23.11.x for 23.11.04
Comment 6 Lucas Gass (lukeg) 2024-03-19 15:10:28 UTC
Backported to 23.05.x for upcoming 23.05.10.