From 4b17f3dc3541f1ea9d9ca6db40e43e1e5147d463 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 12 Jan 2022 11:25:59 -0500 Subject: [PATCH] LP#1955079: Staff catalog can't email records The angular staff catalog uses the new print/email records functionality, but calls it without some expected parameters. This causes the backend method to fail as it assumes the params will exist. This commit removes that assumption by testing the length of the parameter list before attempted to read them. Signed-off-by: Mike Rylander Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan --- .../src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 3af4a33d90..bb6618a550 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -2030,7 +2030,9 @@ sub format_biblio_record_entry { my ($auth, $captcha_pass, $email, $subject); if ($for_email) { $auth = shift @_; - ($captcha_pass, $email, $subject) = splice @_, -3, 3; + if (@_ > 5) { # the stuff below is included in the params, safe to splice + ($captcha_pass, $email, $subject) = splice @_, -3, 3; + } } my ($bib_id, $holdings_context_org, $bib_sort, $sort_dir, $group_member) = @_; $holdings_context_org ||= $U->get_org_tree->id; -- 2.43.2