From e97dfd400265743581a7ea91d7b3b4ff142cd29b Mon Sep 17 00:00:00 2001 From: Lisette Scheer Date: Fri, 6 Dec 2024 18:33:11 +0000 Subject: [PATCH] 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 --- .../intranet-tmpl/prog/en/includes/js-patron-format.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc index fd8463ba3a0..ac4d299565e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc @@ -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 ) { -- 2.39.5