http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marc Véron from comment #8)
(In reply to Jonathan Druart from comment #7)
Comment on attachment 45873 [details] [review] [review] Bug 14015 - Checkout: Fix software error if barcode '0' is given
Review of attachment 45873 [details] [review] [review]: -----------------------------------------------------------------
::: circ/circulation.pl @@ +217,5 @@
}
# check and see if we should print +# but do not set to 'yes' if barcode given by user is '0' +if ( ( @$barcodes == 0 ) && ( ! @$barcodes eq '0') && ( $print eq 'maybe' ) ) {
What is supposed to test !@$barcodes eq '0' ??
Hi Jonathan,
The first (already existing) part @$barcodes == 0 tests @$barcodes for numerical equality (no barcodes given). While testing I found out that it evaluates to true for a barcode that is '0'. Because it evaluated to true with a barcode '0', $print was set to 'yes' (but we do not want to print, since we have a barcode). With $print set to 'yes' the borrowernumber is set to '' in line 235, and that leads to the software error in line 473. By adding a test for the barcode not to be equal to '0' by the string equality oparator eq ( ! @$barcodes eq '0'), the value of $print is not set to 'yes' and the barcode '0' is treated as such. Koha will then display the message 'The barcode was not found 0' (as expected)
my $a = ['0']; say "1.is 0" if @$a eq '0'; $a = [0]; say "2.is 0" if @$a eq '0'; Does not print anything. I have tried your changes and remove the last 2 tests and everything looks ok. -- You are receiving this mail because: You are watching all bug changes.