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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lisette Scheer 2024-12-06 18:33:11 +00:00 committed by Katrin Fischer
parent 2a17ad69ea
commit 6a839ff666
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 6 additions and 2 deletions

View File

@ -36,9 +36,13 @@
else {
name = preferred_name + ' ' + surname;
}
if ( name.replace(' ', '').length == 0 ) {
return _("A patron from %s").format(patron.library.name);
if ( patron.library ) {
return _("A patron from %s").format(patron.library.name);
}
else {
return _("A patron from another library");
}
}
if ( config && config.hide_patron_name ) {