Bug 37399

Summary: Item type not displayed on holdings table if noItemTypeImages is disabled
Product: Koha Reporter: Emmi Takkinen <emmi.takkinen>
Component: CatalogingAssignee: Emmi Takkinen <emmi.takkinen>
Status: Needs documenting --- QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: aleisha, david, fridolin.somers, lucas, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes the staff interface holdings table for a record so that the 'Item type' column is displayed when the "noItemTypeImages" system preference is set to 'Don't show'.
Version(s) released in:
24.11.00,24.05.04
Circulation function:
Bug Depends on: 33568    
Bug Blocks:    
Attachments: Bug 37399: Fix showing itemtype on holdings table
Bug 37399: Fix showing itemtype on holdings table
Bug 37399: Fix showing itemtype on holdings table

Description Emmi Takkinen 2024-07-18 09:28:09 UTC
If syspref "noItemTypeImages" is disabled, holdings table won't display itemtype column. 

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items. 
=> Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
=> Itemtype column is no longer displayed on holdings table.
Comment 1 Emmi Takkinen 2024-07-18 09:37:28 UTC
Created attachment 169126 [details] [review]
Bug 37399: Fix showing itemtype on holdings table

If syspref "noItemTypeImages" is disabled, holdings
table won't display itemtype column. This patch
fixes this.

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items.
=> Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
=> Itemtype column is no longer displayed on holdings table.
4. Apply this patch.
=> Now column should be displayed correctly.

Sponsored-by: Koha-Suomi Oy
Comment 2 Owen Leonard 2024-07-18 16:49:14 UTC
Created attachment 169150 [details] [review]
Bug 37399: Fix showing itemtype on holdings table

If syspref "noItemTypeImages" is disabled, holdings table won't display
itemtype column. This patch fixes this.

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items.
   => Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
   => Itemtype column is no longer displayed on holdings table.
4. Apply this patch.
   => Now column should be displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 David Nind 2024-07-18 21:00:56 UTC
I've changed the bug type to "normal" from "enhancement", as it is something that isn't working when it should.
Comment 4 Tomás Cohen Arazi (tcohen) 2024-07-19 14:26:04 UTC
Created attachment 169230 [details] [review]
Bug 37399: Fix showing itemtype on holdings table

If syspref "noItemTypeImages" is disabled, holdings table won't display
itemtype column. This patch fixes this.

To reproduce:
1. Enable syspref "noItemTypeImages".
2. Find biblio with items.
   => Note that itemtype column is displayed on holdings table.
3. Disable syspref "noItemTypeImages".
   => Itemtype column is no longer displayed on holdings table.
4. Apply this patch.
   => Now column should be displayed correctly.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Martin Renvoize (ashimema) 2024-07-22 09:41:04 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 6 Aleisha Amohia 2024-07-31 00:43:31 UTC
This fixes a bug for the holdings table in the staff interface in 24.05.

If noItemTypeImages is disabled, we get the "Processing" box for a while, and in the console is an error: 

`Uncaught ReferenceError: item_type_description is not defined`

This patches moves the important line outside of the [% UNLESS %] block:

`let item_type_description = row._strings.item_type_id.str;`

so that item_type_description can be defined.

Please backport :)
Comment 7 Lucas Gass (lukeg) 2024-08-28 19:54:41 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 8 Fridolin Somers 2024-09-10 13:16:49 UTC
Depends on Bug 33568 not in 23.11.x