Bug 37866

Summary: Unable to resolve claim from patron details page
Product: Koha Reporter: Emmi Takkinen <emmi.takkinen>
Component: CirculationAssignee: Emmi Takkinen <emmi.takkinen>
Status: Passed QA --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: minor    
Priority: P5 - low CC: emily.lamancusa, gmcharlt, kyle.m.hall
Version: Main   
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:
Circulation function:
Attachments: Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled
Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled
Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled
Bug 37866: (QA follow-up) Fix another missed case

Description Emmi Takkinen 2024-09-09 11:55:18 UTC
If ones tries to resolve a claim from patrons detail page, "Resolve return claim" pop up isn't displayed. Page just jumps to the top of the page. However this works from the patron check out page.

To reproduce:
1. Find patron with claims (or create them).
2. Navigate to patrons detail page and from there open "Claims" tab.
3. Press "Resolve" button.
=> Pop up isn't displayed and page jumps to the top of the page. 
4. Repeat from patrons check out page.
=> Pop up is displayed.
Comment 1 Owen Leonard 2024-09-09 12:08:49 UTC
I can't reproduce this bug in main
Comment 2 Emmi Takkinen 2024-09-10 09:40:40 UTC
I was able reproduce this also in Biblibre sandbox. For some reason, even thought both patron Detail and Check out pages share the same code to create "Resolve" button and display pop up module, in Detail page clicking "Resolve" doesn't launch click function in resolve_claim_modal.js (first line).
Comment 3 Emmi Takkinen 2024-09-11 10:33:01 UTC
This happens when ClaimReturnedLostValue syspref is not enabled. In moremember.tt line 765 we only check if ClaimReturnedLostValue is enabled. In circulation.tt line 1023 we check if either ClaimReturnedLostValue _or_ BundleLostValue syspref is enabled.

Here's updated plan to reproduce this bug:
1. Disable syspref "ClaimReturnedLostValue" (set used value empty).
2. Find patron with claims (or create them).
3. Navigate to patrons detail page and from there open "Claims" tab.
4. Press "Resolve" button.
=> Pop up isn't displayed and page jumps to the top of the page. 
5. Repeat from patrons check out page.
=> Pop up is displayed.
Comment 4 Emmi Takkinen 2024-09-11 11:16:31 UTC
Created attachment 171301 [details] [review]
Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled

If ones tries to resolve a claim from patrons detail page
and syspref ClaimReturnedLostValue is disabled,
"Resolve return claim" pop up isn't displayed. Page just
jumps to the top of the page. However this works from the
patron check out page.

This happens because in moremember.tt line 765 we only
check if  ClaimReturnedLostValue is enabled. In
circulation.tt line 1023 we check if either
ClaimReturnedLostValue or BundleLostValue syspref is enabled.

To test:
1. Disable syspref "ClaimReturnedLostValue" (set used value empty).
2. Find patron with claims (or create them).
3. Navigate to patrons detail page and from there open "Claims" tab.
4. Press "Resolve" button.
=> Pop up isn't displayed and page jumps to the top of the page.
5. Repeat steps on patrons check out page.
=> Pop up is displayed.
6. Apply this patch.
=> Pop up should now be displayed both in patrons details and check
out pages.

Sponsored-by: Koha-Suomi Oy
Comment 5 Owen Leonard 2024-09-11 17:34:35 UTC
Created attachment 171352 [details] [review]
Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled

If ones tries to resolve a claim from patrons detail page
and syspref ClaimReturnedLostValue is disabled,
"Resolve return claim" pop up isn't displayed. Page just
jumps to the top of the page. However this works from the
patron check out page.

This happens because in moremember.tt line 765 we only
check if  ClaimReturnedLostValue is enabled. In
circulation.tt line 1023 we check if either
ClaimReturnedLostValue or BundleLostValue syspref is enabled.

To test:
1. Disable syspref "ClaimReturnedLostValue" (set used value empty).
2. Find patron with claims (or create them).
3. Navigate to patrons detail page and from there open "Claims" tab.
4. Press "Resolve" button.
=> Pop up isn't displayed and page jumps to the top of the page.
5. Repeat steps on patrons check out page.
=> Pop up is displayed.
6. Apply this patch.
=> Pop up should now be displayed both in patrons details and check
out pages.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Emmi Takkinen 2024-09-13 09:15:44 UTC
I was thinking about this some more, is it really wise to prevent pop up from launching if syspref is off but still display button in UI? It's kinda confusing for the user to have button there but no any kind of hint why it's not working.
Comment 7 Emily Lamancusa (emlam) 2024-11-12 20:04:15 UTC
(In reply to Emmi Takkinen from comment #6)
> I was thinking about this some more, is it really wise to prevent pop up
> from launching if syspref is off but still display button in UI? It's kinda
> confusing for the user to have button there but no any kind of hint why it's
> not working.

Looks like the bug was a missed case from 66b35f50 - Bug 28854: Enable claims return view when BundleLostValue is set. The button (actually, all return claims functionality) is hidden if both ClaimReturnedLostValue and BundleLostValue are empty. So this should be fine - the check for BundleLostValue just got missed in this spot, causing the modal to not load when it should have.
Comment 8 Emily Lamancusa (emlam) 2024-11-12 20:47:57 UTC
Created attachment 174438 [details] [review]
Bug 37866: Unable to resolve claim from patron details page if syspref ClaimReturnedLostValue is disabled

If ones tries to resolve a claim from patrons detail page
and syspref ClaimReturnedLostValue is disabled,
"Resolve return claim" pop up isn't displayed. Page just
jumps to the top of the page. However this works from the
patron check out page.

This happens because in moremember.tt line 765 we only
check if  ClaimReturnedLostValue is enabled. In
circulation.tt line 1023 we check if either
ClaimReturnedLostValue or BundleLostValue syspref is enabled.

To test:
1. Disable syspref "ClaimReturnedLostValue" (set used value empty).
2. Find patron with claims (or create them).
3. Navigate to patrons detail page and from there open "Claims" tab.
4. Press "Resolve" button.
=> Pop up isn't displayed and page jumps to the top of the page.
5. Repeat steps on patrons check out page.
=> Pop up is displayed.
6. Apply this patch.
=> Pop up should now be displayed both in patrons details and check
out pages.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 9 Emily Lamancusa (emlam) 2024-11-12 20:47:59 UTC
Created attachment 174439 [details] [review]
Bug 37866: (QA follow-up) Fix another missed case

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>