Bug 36099

Summary: JS error in console on non-existent biblio record
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Staff interfaceAssignee: Pedro Amorim <pedro.amorim>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: trivial    
Priority: P5 - low CC: david, fridolin.somers, gmcharlt, lucas, oleonard, pedro.amorim
Version: unspecified   
Hardware: All   
OS: All   
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
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty
Bug 36099: count and holdcount template vars into JS vars should default to 0 if empty

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.