[Bug 29883] New: Uninitialized value warning when GetAuthorisedValues gets called with no parameters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Bug ID: 29883 Summary: Uninitialized value warning when GetAuthorisedValues gets called with no parameters Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: stalkernoid@gmail.com Reporter: stalkernoid@gmail.com QA Contact: testopia@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=29883 Peter Vashchuk <stalkernoid@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 --- Comment #1 from Peter Vashchuk <stalkernoid@gmail.com> --- Created attachment 129472 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129472&action=edit Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub GetAuthorisedValues is defined with optional parameter $category but it is instantly interpolated without preventing "Use of uninitialized value $category in concatenation (.) or string at .../C4/Koha.pm line 491." warning. As category param is optional, we can avoid throwing that warn as it is something that can happen and is not an actual error: C<$category> returns authorized values for just one category (optional). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Andrew Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nugged@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #2 from David Nind <david@davidnind.com> --- Happy to test, but how can I generate the warning? Want to generate the warning, however that is done), then see if it goes away after the patch is applied. I updated the description for the OPAC for authorised values for CCODE and viewed records in the OPAC. This didn't generate the warning. (There is a different warning though when accessing the details page in the OPAC and staff interface: [2022/02/05 22:08:30] [WARN] Use of uninitialized value $value in concatenation (.) or string at /kohadevbox/koha/C4/XSLT.pm line 289.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 --- Comment #3 from Andrew Nugged <nugged@gmail.com> --- Let me help with this, I will try to find where... I see there's dry call to: my $avs = C4::Koha::GetAuthorisedValues(); in svc url: /cgi-bin/koha/svc/cataloguing/framework Aha, ... so here: David: if you go from the usual MARC-editor (new record): http://localhost:8080/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode= into the advanced editor (Settings -> Switch to the advanced editor): so URL will be: /cgi-bin/koha/cataloguing/editor.pl you will get that warning without this patch and won't get with the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 --- Comment #4 from David Nind <david@davidnind.com> --- Thanks Andrew! The advanced editor is currently broken in master (bug 30097), so I'll look at this when that is fixed (unless someone else beats me to it!). David -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 --- Comment #5 from Andrew Nugged <nugged@gmail.com> --- ok I might to search for another "reproduction example", as I know Petro got this warning just from many production logs as a "statistical frequent one" ... there is a need to go deeper into production logs (I might then...) to find what request sequence caused it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 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=29883 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129472|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 135462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135462&action=edit Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub GetAuthorisedValues is defined with optional parameter $category but it is instantly interpolated without preventing "Use of uninitialized value $category in concatenation (.) or string at .../C4/Koha.pm line 491." warning. As category param is optional, we can avoid throwing that warn as it is something that can happen and is not an actual error: C<$category> returns authorized values for just one category (optional). 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=29883 --- Comment #7 from David Nind <david@davidnind.com> --- Testing notes using (koha-testing-docker): 1. Generated error ([2022/05/31 04:34:48] [WARN] Use of uninitialized value $category in concatenation (.) or string at /kohadevbox/koha/C4/Koha.pm line 491.) by: . enabling the Advanced Catalogiing Editor (system preference EnableAdvancedCatalogingEditor) . from the cataloging module, creating a new record . switching between the basic editor and advanced editor . view the log to see the message: vi /var/log/koha/kohadev/plack-intranet-error.log 2. After patch applied and step 1 repeated, the error message was no longer added to the log. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Jonathan Druart <jonathan.druart+koha@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=29883 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135462|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135481 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135481&action=edit Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub GetAuthorisedValues is defined with optional parameter $category but it is instantly interpolated without preventing "Use of uninitialized value $category in concatenation (.) or string at .../C4/Koha.pm line 491." warning. As category param is optional, we can avoid throwing that warn as it is something that can happen and is not an actual error: C<$category> returns authorized values for just one category (optional). 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=29883 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135482 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135482&action=edit Bug 29883: Add 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=29883 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30870 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30870 [Bug 30870] Don't skip tests if Test::Deep is not installed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart+koha@gmail. |y.org |com CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.01 released in| | --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to stable |Needs documenting --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29883 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org