Bugzilla – Attachment 88816 Details for
Bug 22778
Suggestions with no "suggester" can cause errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22778: Suggestions with no "suggester" can cause errors
Bug-22778-Suggestions-with-no-suggester-can-cause-.patch (text/plain), 3.61 KB, created by
Kyle M Hall (khall)
on 2019-04-25 19:52:38 UTC
(
hide
)
Description:
Bug 22778: Suggestions with no "suggester" can cause errors
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-04-25 19:52:38 UTC
Size:
3.61 KB
patch
obsolete
>From e73f7ef3b8a43e9ca21ea47b8e8ee4b9721496c2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 25 Apr 2019 15:50:35 -0400 >Subject: [PATCH] Bug 22778: Suggestions with no "suggester" can cause errors > >If one tries to modify a suggestion that has no suggester you will get the following error: > >Can't call method "lang" on an undefined value at /usr/share/koha/lib/C4/Suggestions.pm line 506 > >Koha assumes that every suggestion has a borrowernumber in suggestedby > >Test Plan: >1) Create a suggestion with an unpopulated suggestedby >2) Attempt to modify that suggestion >3) Note the error >4) Apply this patch >5) Restart all teh things >6) Attempt to modify that suggestion >7) No error! >--- > C4/Suggestions.pm | 50 ++++++++++++++++++++++++----------------------- > 1 file changed, 26 insertions(+), 24 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 70b7b0de02..0f87c4e97b 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -503,30 +503,32 @@ sub ModSuggestion { > # fetch the entire updated suggestion so that we can populate the letter > my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); > my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} ); >- if ( >- my $letter = C4::Letters::GetPreparedLetter( >- module => 'suggestions', >- letter_code => $full_suggestion->{STATUS}, >- branchcode => $full_suggestion->{branchcode}, >- lang => $patron->lang, >- tables => { >- 'branches' => $full_suggestion->{branchcode}, >- 'borrowers' => $full_suggestion->{suggestedby}, >- 'suggestions' => $full_suggestion, >- 'biblio' => $full_suggestion->{biblionumber}, >- }, >- ) >- ) >- { >- C4::Letters::EnqueueLetter( >- { >- letter => $letter, >- borrowernumber => $full_suggestion->{suggestedby}, >- suggestionid => $full_suggestion->{suggestionid}, >- LibraryName => C4::Context->preference("LibraryName"), >- message_transport_type => 'email', >- } >- ) or warn "can't enqueue letter $letter"; >+ if ($patron) { >+ if ( >+ my $letter = C4::Letters::GetPreparedLetter( >+ module => 'suggestions', >+ letter_code => $full_suggestion->{STATUS}, >+ branchcode => $full_suggestion->{branchcode}, >+ lang => $patron->lang, >+ tables => { >+ 'branches' => $full_suggestion->{branchcode}, >+ 'borrowers' => $full_suggestion->{suggestedby}, >+ 'suggestions' => $full_suggestion, >+ 'biblio' => $full_suggestion->{biblionumber}, >+ }, >+ ) >+ ) >+ { >+ C4::Letters::EnqueueLetter( >+ { >+ letter => $letter, >+ borrowernumber => $full_suggestion->{suggestedby}, >+ suggestionid => $full_suggestion->{suggestionid}, >+ LibraryName => C4::Context->preference("LibraryName"), >+ message_transport_type => 'email', >+ } >+ ) or warn "can't enqueue letter $letter"; >+ } > } > } > return $status_update_table; >-- >2.20.1 (Apple Git-117)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22778
:
88816
|
102229
|
102426
|
102581
|
102582
|
102611
|
102612