[Bug 40277] New: Warn in C4::Koha::GetAuthorisedValues()
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Bug ID: 40277 Summary: Warn in C4::Koha::GetAuthorisedValues() Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org When using not logged in OPAC, we see warns : 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 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25790 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25790 [Bug 25790] [OMNIBUS] warnings removal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 183644 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183644&action=edit Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues() When using not logged in OPAC, we see warns : 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 Patch fixes wy using C4::Context::mybranch() Test plan: 1.1) Without patch 1.2) Go to OPAC without logging in, open some pages 1.3) Check you have the warning in logs 2.1) Apply patch 2.2) Go to OPAC without logging in, open some pages 2.3) Check you don't have the warning in logs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ah I can get this warn on KTD. Looks like it is when changing language. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- I couldn't replicate the issue on KTD. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Nind from comment #3)
I couldn't replicate the issue on KTD.
Set OpacAdvancedSearchTypes to something else than "itemtypes". eg. "loc", then go to http://localhost:8080/cgi-bin/koha/opac-search.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183644|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- 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 <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the cause of an release notes| |unnecessary warning | |message[1] in the logs when | |searching the OPAC when not | |logged in. (This warning | |was occurring when the | |OpacAdvancedSearchTypes | |system preference was set | |to something other than | |"itemtypes", for example | |"loc".) | | | |[1] Warning message: | |[WARN] Use of uninitialized | |value $branch_limit in | |concatenation (.) or string | |at ... --- Comment #6 from David Nind <david@davidnind.com> --- (In reply to Jonathan Druart from comment #4)
(In reply to David Nind from comment #3)
I couldn't replicate the issue on KTD.
Set OpacAdvancedSearchTypes to something else than "itemtypes". eg. "loc", then go to http://localhost:8080/cgi-bin/koha/opac-search.pl
Thanks Jonathan! I've amended the commit message to include this step -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183803|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183838&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 <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183839&action=edit Bug 40277: Add a test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Thanks a lot for the UT Joubu ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main CC| |lucas@bywatersolutions.com Version(s)| |25.11.00 released in| | --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.02 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 --- Comment #11 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|25.11.00,25.05.02 |25.11.00,25.05.02,24.11.08 released in| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #13 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40277 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #14 from David Nind <david@davidnind.com> --- Bug fix, no changes to the manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org