Bug 4973 - process_koc.pl fails to process returns because of \r
Summary: process_koc.pl fails to process returns because of \r
Status: CLOSED DUPLICATE of bug 4084
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 18:16 UTC by Magnus Enger
Modified: 2012-10-26 00:41 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2010-07-08 18:16:00 UTC
I was having trouble processing koc-files with /cgi-bin/koha/offline_circ/process_koc.pl. I got this message, both for items that were on loan and items that were not on loan: "Warning: Unable to determine patron from item barcode (71556236). Cannot check in." 71556236 is a valid barcode. 

This hack on around line 192 of offline_circ/process_koc.pl fixes it: 

sub parse_command_line {
     my $command_line = shift;
     chomp($command_line);
     $command_line =~ s/\r//g;

Comments from IRC: 

[20:04] pianohack: magnus: Are these windows-style \r\n lines?
[20:04] magnus: pianohack: probably
[20:04] pianohack: magnus: All chomp does is remove the line ending on the platform you're running on
[20:04] pianohack: linux server, windows client?
[20:04] magnus: yup
[20:05] magnus: adding $command_line =~ s/\r//g; solves it
[20:05] gmcharlt: s/\r$//g; would be slightly more precise
[20:05] pianohack: magnus: You might consider just replacing chomp entirely with s/[\r\n]*$//g
[20:05] pianohack: No reason to have both, I don't think
Comment 1 Magnus Enger 2011-03-01 11:54:41 UTC

*** This bug has been marked as a duplicate of bug 4084 ***