[Bug 21036] New: Just a bunch of warnings

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 21036] New: Just a bunch of warnings

bugzilla-daemon
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: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #1 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #2 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]-c
                   |                            |ommunity.org

--- Comment #3 from Jonathan Druart <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #4 from Marcel de Rooy <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #5 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #6 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Just a bunch of warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> changed:

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

--- Comment #7 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Patch complexity|---                         |Small patch
           Assignee|[hidden email]-commun |[hidden email]
                   |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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #8 from M. Tompsett <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

--- Comment #9 from Marcel de Rooy <[hidden email]> ---
(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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> changed:

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

--- Comment #10 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> changed:

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

--- Comment #11 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> changed:

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

--- Comment #12 from Marcel de Rooy <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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 | Threaded
Open this post in threaded view
|

[Bug 21036] Fix a bunch of older warnings

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21036

Marcel de Rooy <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://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/