From 75e0d65da6b19d0bdbb24a5aa315e780a7e6d920 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 2 Jun 2026 17:26:35 +0000 Subject: [PATCH] Bug 42757: Use default suggestor or fallback to librarian To test: 1. Find a patron 2. From the patron account click the "Purchase suggestions" button 3. Make a suggestion 4. That suggestion is not associated with the patron from step 1 5. APPLY PATCH and restart_all 6. Repeart steps 1 -3. The purchase suggestion suggesedby should be the patron from step 1 7. Go Acquisitions -> Suggestions -> Add suggestion 8. Make sure when you do it this way the suggestedby is set to the logged-in-user by default Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass (cherry picked from commit 9122ad9dc639e58237d2734b12409174efe034a6) Signed-off-by: Baptiste Wojtkowski --- suggestion/suggestion.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index c8e7d1d295..9303d5923b 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -282,8 +282,10 @@ if ( $op =~ /cud-save/ ) { } } elsif ( $op eq 'add_form' ) { + # get the patron that is suggesting or fall back to the logged-in-user + my $default_suggester = $suggestedby ? Koha::Patrons->find($suggestedby) : $librarian; $template->param( - default_suggester => $librarian, + default_suggester => $default_suggester, default_suggesteddate => dt_from_string, default_branch => C4::Context->userenv->{"branch"}, );