Bug 38530

Summary: ILL request table won't load if libraries are in groups and staff doesn't have view_borrower_infos_from_any_libraries
Product: Koha Reporter: Lisette Scheer <lisette>
Component: ILLAssignee: Lisette Scheer <lisette>
Status: Pushed to main --- QA Contact: Pedro Amorim <pedro.amorim>
Severity: normal    
Priority: P5 - low CC: david, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the interlibrary loan (ILL) requests table so that it loads (instead of saying "Processing") when library groups are used, and: - the library group has the feature "Limit patron visibility to libraries within this group for members" (Limit patron data access by group) set - library staff don't have permission to view patron information from any libraries (view_borrower_infos_from_any_libraries). The ILL table now loads, and shows "A patron from another library" for the patron details.
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 38530: ILL request table won't load
Bug 38530: ILL request table won't load

Description Lisette Scheer 2024-11-25 18:53:26 UTC
To recreate:

Create 2 library groups and assign one library each to them.

Both groups should have 

Create an ILL request for a patron in group 1.

Create a test staff member in group 2 
Permissions for a test borrower:

catalogue
ill
list_borrowers

make sure they don't have:
view_borrower_infos_from_any_libraries

Log in as the test staff member and attempt to load the ILL page. 
Will say "processing" but never load the table.
Comment 1 Lisette Scheer 2024-12-06 18:50:08 UTC
Created attachment 175270 [details] [review]
Bug 38530: ILL request table won't load

This patch updates the js-patron-format include to show text if the library can't be fetched due to lack of permissions.
To test:
Before applying the patch
1. Create 2 library groups
2. Give both groups the "Limit patron visibility to libraries within this group for members." attribute
3. Assign 1 library to each group.
4. Turn on ILL in the system preferences
5. Create an ILL for a patron in group 1.
6. Create a staff member for the library in group 2 with only the following permissions:
catalogue
ill
list_borrowers
7. Log in as the new staff member.
8. Observe the table never loads.
9. Apply the patch.
10. Refresh the page as the new staff member.
11. Observe the table loads and the patron says "A patron from another library"
12. Log back in as the superlibrarian and confirm you can still see the patron information.
13. Sign off
Comment 2 Pedro Amorim 2024-12-09 10:47:16 UTC
Created attachment 175293 [details] [review]
Bug 38530: ILL request table won't load

This patch updates the js-patron-format include to show text if the library can't be fetched due to lack of permissions.
To test:
Before applying the patch
1. Create 2 library groups
2. Give both groups the "Limit patron visibility to libraries within this group for members." attribute
3. Assign 1 library to each group.
4. Turn on ILL in the system preferences
5. Create an ILL for a patron in group 1.
6. Create a staff member for the library in group 2 with only the following permissions:
catalogue
ill
list_borrowers
7. Log in as the new staff member.
8. Observe the table never loads.
9. Apply the patch.
10. Refresh the page as the new staff member.
11. Observe the table loads and the patron says "A patron from another library"
12. Log back in as the superlibrarian and confirm you can still see the patron information.
13. Sign off

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 3 Katrin Fischer 2024-12-20 17:17:59 UTC
I believe the strings here show the same problem bug 38450 fixes. Please review! (also needs a rebase)
Comment 4 Katrin Fischer 2024-12-20 17:40:33 UTC
(In reply to Katrin Fischer from comment #3)
> I believe the strings here show the same problem bug 38450 fixes. Please
> review! (also needs a rebase)

It is because I have bug 38450 ready to push on my branch before this one (explains the problem and the conflict). I wanted to push and come back to this, but have issues with the git repository. I am setting it back to PQA for now.
Comment 5 Katrin Fischer 2024-12-23 09:37:45 UTC
Pushed for 25.05!

Well done everyone, thank you!