From 1fafbca4d2ea0efe170e5782b1a450cfde00fe4f Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 16 Sep 2015 15:28:44 +1200 Subject: [PATCH] Bug 14830 - anonymous purchase suggestions are invisible/inaccessible in staff interface Content-Type: text/plain; charset="utf-8" To test bug... 1/ set various suggestion sysprefs like so mysql> select variable, value from systempreferences where variable like '%sugg%'; +-------------------------------------+-------+ | variable | value | +-------------------------------------+-------+ | AllowPurchaseSuggestionBranchChoice | 0 | | AnonSuggestions | 1 | | OpacSuggestionManagedBy | 1 | | OPACViewOthersSuggestions | 0 | | suggestion | 1 | +-------------------------------------+-------+ 2/ create an generic ANON borrower for testing 3/ set 'AnonymousPatron' syspref to ANON's borrowernumber 4/ add a suggestion from the OPAC, without being logged in (ie: an anonymous suggestion) 2/ go to staff interface , fail to see suggestion :'( https://demo-admin.yourkoha.foo/cgi-bin/koha/suggestion/suggestion.pl 3/ apply patch... 4/ go to staff interface , see suggestion! :) (pix attached) https://demo-admin.yourkoha.foo/cgi-bin/koha/suggestion/suggestion.pl 5/ reward yourself with cake (optional) --- C4/Suggestions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index b5af96e..5d45c8e 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -150,7 +150,7 @@ sub SearchSuggestion { if ( defined $suggestion->{branchcode} && $suggestion->{branchcode} ) { unless ( $suggestion->{branchcode} eq '__ANY__' ) { push @sql_params, $suggestion->{branchcode}; - push @query, qq{ AND suggestions.branchcode=? }; + push @query, qq{ AND (suggestions.branchcode=? or suggestions.branchcode is null) }; } } } -- 2.1.4