Bugzilla – Attachment 170781 Details for
Bug 37375
Holdings table not loading if MARC framework is missing certain 952 subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37375: Fix holdings table not loading if MARC framework is missing certain 952 subfields
Bug-37375-Fix-holdings-table-not-loading-if-MARC-f.patch (text/plain), 4.96 KB, created by
Lucas Gass (lukeg)
on 2024-08-27 17:50:58 UTC
(
hide
)
Description:
Bug 37375: Fix holdings table not loading if MARC framework is missing certain 952 subfields
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-08-27 17:50:58 UTC
Size:
4.96 KB
patch
obsolete
>From cb21880dc01f0a61253ae3af8a9f49965a612d3c Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 16 Jul 2024 16:01:45 +0000 >Subject: [PATCH] Bug 37375: Fix holdings table not loading if MARC framework > is missing certain 952 subfields > >When you've catalogued a record with MARC framework that is for some reason missing >certain 952 subfields (8, a, b, c, or y), holdings table is no longer loading but >stuck in the "Processing..." loader. > >To test, open Koha in two browser tabs: > >IN TAB 1 (framework configuration): >1. Create a new MARC framework "TEST", based on the default MARC framework > >IN TAB 2 (record view): >2. Create a new record using MARC framework "TEST" >3. Add an item to the newly created record >4. Observe item visible on the record's holdings list > >IN TAB 1 (framework configuration): >5. Delete all 952 subfields in framework "TEST" except: 8, a, b, c, y > >IN TAB 2 (record view): >6. Refresh page >7. Observe item visible on the record's holdings list >8. Open your browser's console for upcoming error messages > >Iterating remaining subfields in following order, >| <FIELD> | <NAME> >------------------------------------------------------ >| 952$8 | row._strings.collection_code >| 952$c | row._strings.location >| 952$a | row._strings.home_library_id >| 952$b | row._strings.holding_library_id >| 952$y | row._strings.item_type_id > >IN TAB 1 (framework configuration): >9. Delete subfield <FIELD> in framework "TEST" > >IN TAB 2 (record view): >10. Refresh page >11. Observe error "Uncaught TypeError: <NAME> is undefined" (Firefox) >(or Cannot read properties of undefined (reading 'str') (Chromium)) > >12. Apply patch > >IN TAB 2: >13. Refresh page >14. Observe item visible on the record's holdings list > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../html_helpers/tables/items/catalogue_detail.inc | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 02b6edfa0e7..0860cb4c8e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -337,7 +337,7 @@ > orderable: true, > render: function (data, type, row, meta) { > let node = ''; >- let item_type_description = row._strings.item_type_id.str; >+ let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; > [% UNLESS noItemTypeImages %] > let image_location = item_type_image_locations[row.item_type_id]; > node += image_location >@@ -355,7 +355,7 @@ > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return escape_str(row._strings.holding_library_id.str); >+ return escape_str(row._strings.holding_library_id ? row._strings.holding_library_id.str : row.holding_library_id); > } > }, > { >@@ -364,12 +364,12 @@ > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- let nodes = '<span class="homebranchdesc">%s</span>'.format(escape_str(row._strings.home_library_id.str)); >+ let nodes = '<span class="homebranchdesc">%s</span>'.format(escape_str(row._strings.home_library_id ? row._strings.home_library_id.str : row.home_library_id)); > nodes += '<span class="shelvingloc">' > [%# If permanent location is defined, show description or code and %] > [%# display current location in parentheses. If not, display current location. %] > [%# Note that permanent location is a code, and location may be an authval. %] >- let loc_str = row._strings.location.str; >+ let loc_str = row._strings.location ? row._strings.location.str : row.location; > if ( row.permanent_location && row.permanent_location != row.location ) { > let permanent_loc_str = av_loc.get(row.permanent_location); > nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str)); >@@ -385,7 +385,7 @@ > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return escape_str(row._strings.collection_code.str); >+ return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code); > } > }, > [% IF Koha.Preference('EnableItemGroups') %] >-- >2.39.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 37375
:
169051
|
170578
|
170579
|
170702
|
170781
|
170857