Bug 39603

Summary: OPAC advanced search display or ITEMTYPECAT is wrong if other authorised values have the same code
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: OPACAssignee: Lucas Gass (lukeg) <lucas>
Status: Pushed to main --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: ephetteplace
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:
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39603: Make sure authorised value category is ITEMTYPECAT
Bug 39603: Make sure authorised value category is ITEMTYPECAT

Description Lucas Gass (lukeg) 2025-04-10 15:31:28 UTC
To recreate:

1. Add some AVs for ITEMTYPECAT and set some of your item types to be in that Search category. I made one called OTHER
2. Go to the OPAC advanced search page, the item types should be correctly displaying under ITEMTYPECAT with the correct description from ITEMTYPECAT.
3. Create a new AV called OTHER in a different category like 'ERM_AGREEMENT_CLOSURE_REASON'. Make the description something different like 'Wrong description'. 
4. Now go back to the OPAC advanced search.
4. Notice your OTHER option now reads 'Wrong description'.
Comment 1 Lucas Gass (lukeg) 2025-04-10 15:48:50 UTC
Created attachment 180784 [details] [review]
Bug 39603: Make sure authorised value category is ITEMTYPECAT

To test:
1. Add some AVs for ITEMTYPECAT and set some of your item types to be in that Search category. I made one called OTHER
2. Go to the OPAC advanced search page, the item types should be correctly displaying under ITEMTYPECAT with the correct description from ITEMTYPECAT.
3. Create a new AV called OTHER in a different category like 'ERM_AGREEMENT_CLOSURE_REASON'. Make the description something different like 'Wrong description'.
4. Now go back to the OPAC advanced search.
5. Notice your OTHER option now reads 'Wrong description'.
6. APPLY PATCH and restart_all
7. Try again, the OPAC descriptions should now be correct.
Comment 2 Eric Phetteplace 2025-04-10 18:47:44 UTC
Created attachment 180801 [details] [review]
Bug 39603: Make sure authorised value category is ITEMTYPECAT

To test:
1. Add some AVs for ITEMTYPECAT and set some of your item types to be in that Search category. I made one called OTHER
2. Go to the OPAC advanced search page, the item types should be correctly displaying under ITEMTYPECAT with the correct description from ITEMTYPECAT.
3. Create a new AV called OTHER in a different category like 'ERM_AGREEMENT_CLOSURE_REASON'. Make the description something different like 'Wrong description'.
4. Now go back to the OPAC advanced search.
5. Notice your OTHER option now reads 'Wrong description'.
6. APPLY PATCH and restart_all
7. Try again, the OPAC descriptions should now be correct.

Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Comment 3 Katrin Fischer 2025-05-06 17:33:42 UTC
What about a nice little regression test? :)
Comment 4 Katrin Fischer 2025-05-07 12:31:33 UTC
Pushed for 25.05!

Well done everyone, thank you!