https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277

David Nind <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #183644|0                           |1
        is obsolete|                            |

--- Comment #5 from David Nind <[email protected]> ---
Created attachment 183803
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183803&action=edit
Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues()

When using the OPAC and you are not logged in, there are warnings
in the logs:
[WARN] Use of uninitialized value $branch_limit in concatenation (.) or string

It comes from C4::Koha::GetAuthorisedValues() :
     my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"}
: "";
     my $cache_key    = "AuthorisedValues-$category-$opac-$branch_limit";

C4::Context->userenv->{"branch"} can be undef

The patch fixes using C4::Context::mybranch().

Test plan:
1. Set the OpacAdvancedSearchTypes system preference to something
   other than "itemtypes", for example "loc".
2. Go to OPAC without logging in, and perform a search.
3. Check the /var/log/koha/kohadev/plack-opac-error.log and note
   the warnings in the log:
   [WARN] Use of uninitialized value $branch_limit in concatenation (.) or ...
   (Alternative, tail the logs: tail -f /var/log/koha/kohadev/*.log
4. Apply the patch.
5. Repeat step 2 and check that there are no longer any warnings.
6. Sign off.

Signed-off-by: David Nind <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to