[Bug 14191] New: Noisy warns in C4/XSLT.pm
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Bug ID: 14191 Summary: Noisy warns in C4/XSLT.pm Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org "Use of uninitialized value in numeric eq" at an if statement. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 39109 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39109&action=edit Bug 14191: Use of operators causing warn in C4/XSLT.pm In this if statement causing the warns, || is used in the left arguments. This patch changes these to // as I think this is essentially the same thing. I don't know that this is the best way to fix this but it silences the warns. To test: 1) On the OPAC, do a simple search for an item that will return results (ie by Keyword, search for "a") 2) Notice the warns in the error log 3) Apply patch 4) Reload page (search for "a") 5) Notice page still works but no warns -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |bgkriegel@gmail.com --- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Aleisha, // is not exactly the same as ||, as it returns first 'defined' value Anyway, on current master I don't see the warning messages, and you changed the first condition before: if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) after: if ( $item->{notforloan} > 0 // $item->{notforloan} > 0 // $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) $item->{itemnotforloan} > 0 <=> $item->{notforloan} > 0 First and second condition on your 'if' are equal! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39109|0 |1 is obsolete| | --- Comment #3 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 39292 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39292&action=edit Bug 14191: Use smartmatch operator rather than equality operator This patch uses ~~ instead of == which silences the warns. Still not sure this is the best way to fix this but the warns are not there. Feel free to comment if you have any other better suggestions. To test: 1) On the OPAC, do a simple search for an item that will return results (ie by Keyword, search for "a") 2) Notice the warns in the error log 3) Apply patch 4) Reload page (search for "a") 5) Notice page still works but no warns -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #4 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Aleisha, seems that your second patch needs the first! You need to un-obsolete first patch fatal: sha1 information is lacking or useless (C4/XSLT.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Comments: 1) You wrote my $itemtypes = "" unless GetItemTypes(); here I think you can use // my $itemtypes = GetItemTypes() // ""; 2) About ~~, as per Bug 12151 we can't use smartmatch operator 3) Which Linux/Perl/Apache version are you using? I don't see those warnings, but on Debian weezy there are warnings that do not appear on Ubuntu 14.04 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 --- Comment #5 from Aleisha Amohia <aleishaamohia@hotmail.com> ---
2) About ~~, as per Bug 12151 we can't use smartmatch operator
Do you think we could use a grep here? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39109|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14191 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |FIXED --- Comment #6 from Aleisha Amohia <aleishaamohia@hotmail.com> --- I don't see these warns anymore :) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org