Some code executed in the script opac-suggestions.pl if the system preference AllowPurchaseSuggestionBranchChoice is enabled assumes there is a logged in user. If there is not, patrons will see the error "Internal Server Error".
Created attachment 75302 [details] [review] Bug 20763: AllowPurchaseSuggestionBranchChoice triggers error opac-suggestions.pl is visited without logging in Some code executed in the script opac-suggestions.pl if the system preference AllowPurchaseSuggestionBranchChoice is enabled assumes there is a logged in user. If there is not, patrons will see the error "Internal Server Error". Test Plan: 1) Enable AllowPurchaseSuggestionBranchChoice 2) Enable AnonSuggestions 3) In the OPAC, perform a search that will have no results, click the "Make a purchase suggestion" link. 4) Note the error 5) Apply this patch 6) Reload the page 7) The page should load now!
Created attachment 75567 [details] [review] Bug 20763: AllowPurchaseSuggestionBranchChoice triggers error opac-suggestions.pl is visited without logging in Some code executed in the script opac-suggestions.pl if the system preference AllowPurchaseSuggestionBranchChoice is enabled assumes there is a logged in user. If there is not, patrons will see the error "Internal Server Error". Test Plan: 1) Enable AllowPurchaseSuggestionBranchChoice 2) Enable AnonSuggestions 3) In the OPAC, perform a search that will have no results, click the "Make a purchase suggestion" link. 4) Note the error 5) Apply this patch 6) Reload the page 7) The page should load now! Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com>
One more caused by commit 2b90ea2cb0e5e976de7ddef0151ae83d8ac578e6 Bug 17829: Move GetMember to Koha::Patron
Created attachment 75602 [details] [review] Bug 20763: AllowPurchaseSuggestionBranchChoice triggers error opac-suggestions.pl is visited without logging in Some code executed in the script opac-suggestions.pl if the system preference AllowPurchaseSuggestionBranchChoice is enabled assumes there is a logged in user. If there is not, patrons will see the error "Internal Server Error". Test Plan: 1) Enable AllowPurchaseSuggestionBranchChoice 2) Enable AnonSuggestions 3) In the OPAC, perform a search that will have no results, click the "Make a purchase suggestion" link. 4) Note the error 5) Apply this patch 6) Reload the page 7) The page should load now! Signed-off-by: Pierre-Luc Lapointe <pierreluc.lapointe@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 75603 [details] [review] Bug 20763: Remove unecessary Koha::Patron fetch If $borrowernumber is not set, there is no userenv. So let's pick the library code set in the userenv instead of fetching the Koha::Patron->branchcode from DB Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Kyle, I think the conditions can be simplified. Can you confirm I am not missing something with this follow-up?
Created attachment 75623 [details] [review] Bug 20763: Remove unecessary Koha::Patron fetch If $borrowernumber is not set, there is no userenv. So let's pick the library code set in the userenv instead of fetching the Koha::Patron->branchcode from DB Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to Kyle M Hall from comment #7) > Created attachment 75623 [details] [review] [review] > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Thanks!
Pushed to master for 18.11, awesome work everybody!
This patch has been pushed to 18.05.x and will be in 18.05.01
Pushed to 17.11.x for 17.11.07
Depends on Bug 17829 not in 17.05.x