[Bug 21036] New: Just a bunch of warnings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Bug ID: 21036 Summary: Just a bunch of warnings Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org -- 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=21036 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76686&action=edit Bug 21036: Fix CGI::param in list context warning from opac-passwd.pl Resolve: CGI::param called in list context from package CGI::Compile::ROOT::usr_share_koha_prodclone_opac_opac_2dpasswd_2epl line 55, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436. Add a scalar. Test plan: Speaks for itself. -- 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=21036 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76689 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76689&action=edit Bug 21036: Fix uninitialized value within @itemnumber in string ne Line from 16.11 log: Use of uninitialized value within @itemnumber in string ne at /usr/share/koha/prodclone/reserve/modrequest.pl line 70. Test plan: Read the change. Not 100% identical (numeric zero) but should be enough. This line is probably not needed at all. -- 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=21036 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #2)
Read the change. Not 100% identical (numeric zero) but should be enough. This line is probably not needed at all.
Regarding commit 26469d87a261682dcbde0f41faa844133d10ed5e bug 2520: don't change item-level requests to bib-level It is used to test <input type="hidden" name="itemnumber" value="" /> if item_level_hold it not set. -- 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=21036 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
(In reply to Marcel de Rooy from comment #2)
Read the change. Not 100% identical (numeric zero) but should be enough. This line is probably not needed at all.
Regarding commit 26469d87a261682dcbde0f41faa844133d10ed5e bug 2520: don't change item-level requests to bib-level
It is used to test <input type="hidden" name="itemnumber" value="" /> if item_level_hold it not set.
Thx. That should still work as expected. The itemnumber==0 case is only hypothetical; we do not have such items. Clearing the field should be fine. If the line is needed or not here actually depends on if ModReserve and the routines it calls, can handle an empty string for itemnumber. I would think they do, but to be safe I do not remove the line. -- 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=21036 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76702&action=edit Bug 21036: Fix warnings from C4/Biblio Use of uninitialized value $isbn in string ne at /usr/share/koha/prodclone/C4/Biblio.pm line 1794. (16.11 line number) Trivial edit. And these warnings from TransformHtmlToXml (with 16.11 line numbers): Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2527. Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. substr outside of string at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. Indicator in 952 is empty at /usr/share/koha/prodclone/C4/Biblio.pm line 2534. The last warning is not needed and can be removed. Note that the code used the construct @$indicator[$j] for $$indicator[$j]. The first is an array slice. This worked in list context. But apparently the second was meant to be used. And can be rewritten as $indicator->[$j] which generally is considered more readable. The code around indicator1/2 and ind1/2 is simplified. This change is applied twice in the same sub. Test plan: Read the changes. Run t/Biblio/TransformHtmlToXml.t -- 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=21036 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76703 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76703&action=edit Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm Like this one (16.11 line number): Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070. We need to add a scalar to some MARC::Field::subfield calls. In list context the empty list returned might affect the parameter hash around it. Test plan: Could reproduce this warning easily from OPAC authority search. opac-authorities-home.pl calling BuildSummary. -- 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=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76703|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76704 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76704&action=edit Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm Like this one (16.11 line number): Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070. We need to add a scalar to some MARC::Field::subfield calls. In list context an empty list returned affects the hash built around it. Test plan: Could reproduce this warning easily from OPAC authority search. opac-authorities-home.pl calling BuildSummary. -- 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=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | Status|NEW |Needs Signoff Summary|Just a bunch of warnings |Fix a bunch of older | |warnings -- 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=21036 --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 76702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76702 Bug 21036: Fix warnings from C4/Biblio Review of attachment 76702: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21036&attachment=76702) ----------------------------------------------------------------- ::: C4/Biblio.pm @@ +2324,4 @@
if ( ( @$tags[$i] ne $prevtag ) ) { $close_last_tag = 0; $j++ unless ( @$tags[$i] eq "" ); + my $str = ( $indicator->[$j] // q{} ) . ' '; # extra space prevents substr outside of string warn
Shouldn't this be two spaces? just because substr(' ',1,1) doesn't explode, doesn't mean you shouldn't hand it a nice string. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to M. Tompsett from comment #8)
Comment on attachment 76702 [details] [review] Bug 21036: Fix warnings from C4/Biblio
Review of attachment 76702 [details] [review]: -----------------------------------------------------------------
::: C4/Biblio.pm @@ +2324,4 @@
if ( ( @$tags[$i] ne $prevtag ) ) { $close_last_tag = 0; $j++ unless ( @$tags[$i] eq "" ); + my $str = ( $indicator->[$j] // q{} ) . ' '; # extra space prevents substr outside of string warn
Shouldn't this be two spaces? just because substr(' ',1,1) doesn't explode, doesn't mean you shouldn't hand it a nice string.
This seems to be nice enough ;) Since $str goes directly into _default_ind_to_space, it really does not matter. But I do not mind adding a space.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76702|0 |1 is obsolete| | --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 78455 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78455&action=edit Bug 21036: Fix warnings from C4/Biblio Use of uninitialized value $isbn in string ne at /usr/share/koha/prodclone/C4/Biblio.pm line 1794. (16.11 line number) Trivial edit. And these warnings from TransformHtmlToXml (with 16.11 line numbers): Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2527. Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. substr outside of string at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. Indicator in 952 is empty at /usr/share/koha/prodclone/C4/Biblio.pm line 2534. The last warning is not needed and can be removed. Note that the code used the construct @$indicator[$j] for $$indicator[$j]. The first is an array slice. This worked in list context. But apparently the second was meant to be used. And can be rewritten as $indicator->[$j] which generally is considered more readable. The code around indicator1/2 and ind1/2 is simplified. This change is applied twice in the same sub. Test plan: Read the changes. Run t/Biblio/TransformHtmlToXml.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76704|0 |1 is obsolete| | --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 78456 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=78456&action=edit Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm Like this one (16.11 line number): Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070. We need to add a scalar to some MARC::Field::subfield calls. In list context an empty list returned affects the hash built around it. Test plan: Could reproduce this warning easily from OPAC authority search. opac-authorities-home.pl calling BuildSummary. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76686|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Comment on attachment 76686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76686 Bug 21036: Fix CGI::param in list context warning from opac-passwd.pl Moved this fix to 21547 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21547 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Kelly McElligott <kelly@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kelly@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Bouzid Fergani <bouzid.fergani@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78456|0 |1 is obsolete| | --- Comment #13 from Bouzid Fergani <bouzid.fergani@inlibro.com> --- Created attachment 88969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88969&action=edit Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm Like this one (16.11 line number): Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070. We need to add a scalar to some MARC::Field::subfield calls. In list context an empty list returned affects the hash built around it. Test plan: Could reproduce this warning easily from OPAC authority search. opac-authorities-home.pl calling BuildSummary. Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76689|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 89164 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89164&action=edit Bug 21036: Fix uninitialized value within @itemnumber in string ne Line from 16.11 log: Use of uninitialized value within @itemnumber in string ne at /usr/share/koha/prodclone/reserve/modrequest.pl line 70. Test plan: Read the change. Not 100% identical (numeric zero) but should be enough. This line is probably not needed at all. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #78455|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 89165 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89165&action=edit Bug 21036: Fix warnings from C4/Biblio Use of uninitialized value $isbn in string ne at /usr/share/koha/prodclone/C4/Biblio.pm line 1794. (16.11 line number) Trivial edit. And these warnings from TransformHtmlToXml (with 16.11 line numbers): Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2527. Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. substr outside of string at /usr/share/koha/prodclone/C4/Biblio.pm line 2528. Indicator in 952 is empty at /usr/share/koha/prodclone/C4/Biblio.pm line 2534. The last warning is not needed and can be removed. Note that the code used the construct @$indicator[$j] for $$indicator[$j]. The first is an array slice. This worked in list context. But apparently the second was meant to be used. And can be rewritten as $indicator->[$j] which generally is considered more readable. The code around indicator1/2 and ind1/2 is simplified. This change is applied twice in the same sub. Test plan: Read the changes. Run t/Biblio/TransformHtmlToXml.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #88969|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 89166 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89166&action=edit Bug 21036: Remove odd number of elements warnings from AuthoritiesMarc.pm Like this one (16.11 line number): Odd number of elements in anonymous hash at C4/AuthoritiesMarc.pm line 1070. We need to add a scalar to some MARC::Field::subfield calls. In list context an empty list returned affects the hash built around it. Test plan: Could reproduce this warning easily from OPAC authority search. opac-authorities-home.pl calling BuildSummary. Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Always nice to see a few warning cleared up.. these three patches perform well for me and I can't find any regressions. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.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=21036 --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thanks Bouzid and Martin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #19 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.05.00, 18.11.06 released in| | Status|Pushed to Master |Pushed to Stable --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.11.x for 18.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #21 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 18.05.x for 18.05.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org