From f1781bff57fcd7d0e3ed710d2ab5f41c002b883f Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 28 May 2015 12:10:23 -0400 Subject: [PATCH] Bug 14001: [DO NOT PUSH TO MASTER] Proof that the $_ is wrong. TEST PLAN --------- 1) create new branch based on master 2) apply this patch 3) make sure you have the barcode of something in your inventory. or add it accordingly. 4) Create a dummy barcode file with that barcode. 5) Home -> Tools -> Inventory/stocktaking 6) Browse for that file 7) Click the 'Compare barcodes list to results:' checkbox. 8) Click the 'Submit' button. 9) Check the koha error log. -- Errors being looked for are like: [Thu May 28 12:14:53.454702 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: [Thu May 28 12:14:53 2015] inventory.pl: Use of uninitialized value in concatenation (.) or string at /home/mtompset/kohaclone/tools/inventory.pl line 278, <$fh> line 1., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.454737 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $_ VERSION: , referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.454757 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $item VERSION: 2015-05-28, referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455013 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: [Thu May 28 12:14:53 2015] inventory.pl: Use of uninitialized value in concatenation (.) or string at /home/mtompset/kohaclone/tools/inventory.pl line 278, <$fh> line 1., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455033 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $_ VERSION: , referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455052 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $item VERSION: 2015-05-25, referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455345 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: [Thu May 28 12:14:53 2015] inventory.pl: Use of uninitialized value in concatenation (.) or string at /home/mtompset/kohaclone/tools/inventory.pl line 278, <$fh> line 1., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455366 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $_ VERSION: , referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455384 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $item VERSION: 2015-05-25, referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455539 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: [Thu May 28 12:14:53 2015] inventory.pl: Use of uninitialized value in concatenation (.) or string at /home/mtompset/kohaclone/tools/inventory.pl line 278, <$fh> line 1., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455539 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $_ VERSION: , referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.455540 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $item VERSION: 2015-05-25, referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.458994 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: [Thu May 28 12:14:53 2015] inventory.pl: Use of uninitialized value in concatenation (.) or string at /home/mtompset/kohaclone/tools/inventory.pl line 325, <$fh> line 1., referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.459018 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $_ VERSION (MOD): , referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl [Thu May 28 12:14:53.459037 2015] [cgi:error] [pid 2428] [client 192.168.45.37:52408] AH01215: $item VERSION (MOD): 2, referer: http://library-admin.debiankoha.ca/cgi-bin/koha/tools/inventory.pl As this should not be pushed to master, and is merely provided as evidence that there is a problem. Confirm that the two places correspond to the VERSION and VERSION (MOD) message locations. The test patch proves the error condition Signed-off-by: Indranil Das Gupta (L2C2 Technologies) --- tools/inventory.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/inventory.pl b/tools/inventory.pl index 63e1da1..786f5db 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -281,6 +281,8 @@ if ( $compareinv2barcd ) { foreach my $item ( @$inventorylist ) { my $cdls = output_pref( { dt => dt_from_string( $_->{datelastseen} ), dateformat => 'iso' } ); + print STDERR "\$_ VERSION: " . $_->{datelastseen} . "\n"; + print STDERR "\$item VERSION: " . $item->{datelastseen} . "\n"; if ( $cdls lt $dls ) { $item->{problem} = 'missingitem'; # We have to push a copy of the item, not the reference @@ -326,6 +328,8 @@ foreach my $item ( @scanned_items ) { } # Modify date last seen for scanned items + print STDERR "\$_ VERSION (MOD): " . $_->{'itemnumber'} . "\n"; + print STDERR "\$item VERSION (MOD): " . $item->{'itemnumber'} . "\n"; ModDateLastSeen($_->{'itemnumber'}); $moddatecount++; } -- 1.9.1