Bug 36984

Summary: Transit pending status breaks holdings info
Product: Koha Reporter: Adolfo Rodríguez Taboada <adolfo.rodriguez>
Component: CatalogingAssignee: Adolfo Rodríguez Taboada <adolfo.rodriguez>
Status: Needs documenting --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: normal    
Priority: P5 - low CC: david, emily.lamancusa, fridolin.somers, lucas, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the status shown in the staff interface holdings table for a record when transferring rotation collections. It now correctly shows as "Transit pending...", instead of showing as "Processing" and not displaying the items available.
Version(s) released in:
24.11.00,24.05.02
Circulation function:
Bug Depends on: 33568    
Bug Blocks:    
Attachments: bug 36984
bug 36984 Fixes "Transit pending from..." message in bibliographic record detail page
Bug 36984: Fix "Transit pending from..." message in bibliographic record detail page
Bug 36984: Fix "Transit pending from..." message in bibliographic record detail page

Description Adolfo Rodríguez Taboada 2024-05-29 11:46:29 UTC
When you transfer a rotating collection, all the items status change to transit requested.

If you check the detail of the bibliography record of any of the items in the collection, it won't show up the items info. It will get stuck Processing because there is a Javascript error.

In the console tab, you  will see the following message:
Uncaught TypeError: Cannot read properties of undefined (reading 'str')
Comment 1 Adolfo Rodríguez Taboada 2024-05-29 11:56:46 UTC
Created attachment 167239 [details] [review]
bug 36984

"Transit pending" status breaks the bibliographic record Intranet detail page

Test plan:
1 Create a rotating collection
2 Add an item
3 Transfer the collection
4 Check the detail page of the bibliography record of the item in the Intranet. Notice that it's stuck Processing
5 Apply patch, restart services
6 Repeat step 4. Now the item shows up with the text "Transit pending from..."
Comment 2 David Nind 2024-05-30 04:22:40 UTC
Thanks for submitting a patch!

Unfortunately, the commit message needs to follow the guidelines at https://wiki.koha-community.org/wiki/Commit_messages

Example: 

Bug XXXXX: Whatever the patch does

A description of what the problem is that this fixes.

Test plan:
1. ...
Comment 3 Adolfo Rodríguez Taboada 2024-05-30 10:09:49 UTC
Created attachment 167269 [details] [review]
bug 36984 Fixes "Transit pending from..." message in bibliographic record detail page

Transfering a rotating collection will mark the items contained in the collection as "Transit pending..." and it will trigger a javascript error in the bibliographic record detail page that breaks the holdings table, leaving it caught in the "Processing..." message. This patch fixes that.

The javascript messages gives this error in the console tab:
Uncaught TypeError: Cannot read properties of undefined (reading 'str')

The error comes from using from_library_ insted of from_library in the file koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc

Test plan:
1 Create a rotating collection
2 Add at least an item to the collection
3 Transfer the rotating collection
4 Check the detail page of the bibliography record of any of the items that belong to that collection in the Intranet. Notice that the holdings table gets stuck "Processing..." and that there is a Javascript error
5 Apply patch, restart services
6 Repeat step 4. Now the holdings tab works as intended and the item from the collection shows up with the text "Transit pending from..." in the Status column
7 Sign off
Comment 4 David Nind 2024-05-30 20:57:11 UTC
Created attachment 167291 [details] [review]
Bug 36984: Fix "Transit pending from..." message in bibliographic record detail page

Transfering a rotating collection will mark the items contained in the collection as "Transit pending..." and it will trigger a javascript error in the bibliographic record detail page that breaks the holdings table, leaving it caught in the "Processing..." message. This patch fixes that.

The javascript messages gives this error in the console tab:
Uncaught TypeError: Cannot read properties of undefined (reading 'str')

The error comes from using from_library_ insted of from_library in the file koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc

Test plan:
1 Create a rotating collection
2 Add at least an item to the collection
3 Transfer the rotating collection
4 Check the detail page of the bibliography record of any of the items that belong to that collection in the Intranet. Notice that the holdings table gets stuck "Processing..." and that there is a Javascript error
5 Apply patch, restart services
6 Repeat step 4. Now the holdings tab works as intended and the item from the collection shows up with the text "Transit pending from..." in the Status column
7 Sign off

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-05-30 21:07:07 UTC
Thanks Adolfo!

I've amended the bug title to: Bug 36984: Fix ....

Testing notes using koha-testing-docker (KTD):
1. To set up a rotating collection:
   1.1 Enable the StockRotation system preference
   1.2 Go to Tools > Patrons and circulation > Rotating collections
   1.3 Add a new collection: + New collection
   1.4 Add items to a collection: add barcodes, for example 
       39999000011418 and 39999000005134
       Tip: To make it simpler, add items that are located in 
       Centerville.
   1.5 Transfer the collection:
       . From the collection page, select 'Transfer'.
       . Choose another library.
       . Select 'Transfer collection'.
Comment 6 Emily Lamancusa (emlam) 2024-06-14 18:13:33 UTC
Created attachment 167759 [details] [review]
Bug 36984: Fix "Transit pending from..." message in bibliographic record detail page

Transfering a rotating collection will mark the items contained in the collection as "Transit pending..." and it will trigger a javascript error in the bibliographic record detail page that breaks the holdings table, leaving it caught in the "Processing..." message. This patch fixes that.

The javascript messages gives this error in the console tab:
Uncaught TypeError: Cannot read properties of undefined (reading 'str')

The error comes from using from_library_ insted of from_library in the file koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc

Test plan:
1 Create a rotating collection
2 Add at least an item to the collection
3 Transfer the rotating collection
4 Check the detail page of the bibliography record of any of the items that belong to that collection in the Intranet. Notice that the holdings table gets stuck "Processing..." and that there is a Javascript error
5 Apply patch, restart services
6 Repeat step 4. Now the holdings tab works as intended and the item from the collection shows up with the text "Transit pending from..." in the Status column
7 Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 7 Emily Lamancusa (emlam) 2024-06-14 18:15:04 UTC
Thanks for catching that, Adolfo! Passing QA
Comment 8 Katrin Fischer 2024-06-21 13:04:22 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 9 Lucas Gass (lukeg) 2024-07-18 19:28:37 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 10 Fridolin Somers 2024-07-19 08:38:24 UTC
Depends on Bug 33568 not in 23.11.x