Go to file
Mark Tompsett 817e8f298f Bug 10625: Inventory/Stocktaking tool cannot handle windows file uploads
The current code uses
    $barcode = <fh>;
logic. This reads until \n, as far as I can tell.
EOL is indicated by \n, \r, and \r\n depending on OS and software.
So, to this end, rather than File::Slurp (which is a potential
memory hog, which is already an issue with no filters), a loop
to pre-read the barcodes was written.

This loop includes:
    $barcode =~ s/\r/\n/g;
    $barcode =~ s/\n\n/\n/g;
    my @data = split(/\n/, $barcode);
    push @uploadedbarcodes,@data;

So, that means that lines ending in \n would have it stripped
and pushed into the uploaded barcodes array.

Lines ending in \r would likely be read as one giant block,
have everything converted to single \n's and then using a split,
the set of barcodes are pushed into the uploaded barcodes array.

Lines ending in \r\n would get that stripped and pushed into the
uploaded barcodes array.

It is then the uploaded barcodes array that is looped over for
validating the barcodes.

TEST PLAN
---------
 1) Back up your database
 2) Download the three sample files (or create your own)
 3) Log in to staff client
 4) Create a branch with no inventory.
 5) Home -> Tools -> Inventory/Stocktaking
 6) Browse for your '\r' test file.
 7) Limit to just that branch
 8) Click 'Submit'
    -- Confirm expected errors
 9) Repeat steps 5-8 with the '\n' test file.
10) Repeat steps 5-8 with the '\r\n' test file.
    -- one of these repetitions should have problems.
11) Apply patch
12) Repeat steps 5-8 for each of the 3 test files.
    -- there should be no issues.
13) run koha qa test tools.

Note: This is a tweak based on Jonathan Druart's comment #16
      I have reset it to needs sign off again.

Followed test plan. Works as expected. qa OK.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d75a751d49)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
2015-06-16 10:40:10 +12:00
C4 Bug 14344: uninitialized value warning C4/Utils/DataTables/Members.pm 2015-06-16 10:21:23 +12:00
Koha Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
OpenILS Bug 9239 QA follow-up: remove stray debug code 2013-03-16 21:32:34 -04:00
acqui Bug 14047: Order z39.50 biblioservers in cataloguing 2015-06-08 14:16:51 +12:00
admin Bug 14042: Get rid of the home made pagination in the auth type admin 2015-05-18 09:46:31 +12:00
authorities Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
basket Bug 14330: Remove unused email_sender from sendbasket/sendshelf 2015-06-16 10:18:41 +12:00
catalogue Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
cataloguing Bug 14047: Order z39.50 biblioservers in cataloguing 2015-06-08 14:16:51 +12:00
circ Bug 12066: New renew page in staff client doesn't record branch in statistics 2015-06-08 11:59:20 +12:00
course_reserves Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
debian Bug 14203: Message for non-existent lang removal 2015-06-08 10:25:20 +12:00
docs Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
errors Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
etc Bug 13981 - Transliterate rule for oe and ae 2015-04-22 17:41:34 +12:00
install_misc Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
installer Updating database to version 3.18.07.001 2015-06-15 11:04:44 +12:00
koha-tmpl Bug 10355: paramater 'object' lost on the road 2015-06-16 10:34:05 +12:00
labels Bug 12911: batch_id for new labels batches can be asssigned to several batches 2015-05-18 09:55:48 +12:00
members Bug 13910: Prevent delete of one's own patron account 2015-05-18 10:57:11 +12:00
misc Bug 13815 - plack loose CGI qw(-utf8) flag creating incorrect utf-8 encoding everywhere 2015-06-16 09:21:14 +12:00
offline_circ Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
opac Bug 14330: Remove unused email_sender from sendbasket/sendshelf 2015-06-16 10:18:41 +12:00
patron_lists Bug 10565: (follow-up) add new user permission for patron list management 2013-10-14 22:43:03 +00:00
patroncards Bug 14122: Patron card: Software error when creating using borrower_number as parameter from URL 2015-05-17 17:50:22 +12:00
plugins Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
reports Bug 14279: Remove CGI::scrolling_list from issues_avg_stats.pl 2015-06-08 13:28:55 +12:00
reserve Bug 8474: Holds done by librarians cause silent errors in koha-error_log, placerequest.pl -> $checkitem 2015-05-12 10:47:39 +12:00
reviews Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
rotating_collections Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
selenium Adding selenium tests for filterMembers 2009-09-30 11:30:37 +02:00
serials Bug 13423: Remove unused serials-recieve 2015-05-18 11:13:09 +12:00
services Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
skel Bug 11078: Add locking to rebuild_zebra 2014-02-28 22:21:41 +00:00
sms Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
suggestion Bug 10752: Alert the librarian if the suggestion has not been added 2015-05-17 16:23:14 +12:00
svc Bug 14299: Today's checkouts not always sorting correctly 2015-06-16 09:12:16 +12:00
t Bug 14112: Silence warnings in t/Charset.t 2015-06-08 12:29:48 +12:00
tags Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
test Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
tmp/modified_authorities changing DO_NOT_REMOVE to README.txt 2007-10-21 19:14:41 -05:00
tools Bug 10625: Inventory/Stocktaking tool cannot handle windows file uploads 2015-06-16 10:40:10 +12:00
virtualshelves Bug 14330: Remove unused email_sender from sendbasket/sendshelf 2015-06-16 10:18:41 +12:00
xt Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
.editorconfig Bug 12545: Add EditorConfig.org file to the source tree 2014-08-22 11:07:45 -03:00
.htaccess Fix file permissions: if it is not a script, it should not be executable. 2010-04-16 00:40:34 -04:00
.mailmap Bug 13314: Follow-up for m.de.rooy in .mailmap 2014-11-26 11:16:18 -03:00
INSTALL Bug 7759, update of install files to use background indexing (and some whitespace tidy) 2012-04-20 16:11:52 +02:00
INSTALL.debian Bug 8092 follow-up: Add optional dependency on CHI 2012-06-09 13:08:18 +02:00
INSTALL.fedora7 Bug 11757: remove dependency on POE 2014-02-15 01:38:15 +00:00
INSTALL.opensuse Bug 11757: remove dependency on POE 2014-02-15 01:38:15 +00:00
INSTALL.ubuntu Bug 7764: (follow-up) editorial tweaks 2013-10-04 16:27:55 +00:00
LICENSE Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
MANIFEST.SKIP Bug 9546 : Updating make manifest tardist 2013-02-06 23:54:46 -05:00
Makefile.PL Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
README Bug 9440 - update Koha's LICENSE file from GPL2 to GPL3 2013-02-12 08:52:10 -05:00
README.robots Bug 6411 add another example to README.robots 2011-07-05 14:48:05 +12:00
about.pl Bug 14006: about.pl checks the wrong zebra index mode 2015-05-17 17:36:25 +12:00
changelanguage.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
edithelp.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
fix-perl-path.PL Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:58 +12:00
help.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
install-CPAN.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
koha_perl_deps.pl bug 10548: fix count of missing required dependencies by koha_perl_deps.pl 2013-07-11 14:03:32 +00:00
kohaversion.pl Updating database to version 3.18.07.001 2015-06-15 11:04:44 +12:00
mainpage.pl Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
rewrite-config.PL Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00

README

Koha is a free software integrated library system.

Koha is distributed under the GNU GPL version 3 or later.
Please read the file LICENSE for more details.

To install or upgrade Koha, please see the INSTALL file appropriate
to your platform.

Report bugs at http://bugs.koha-community.org/

Visit the Koha Project website at http://www.koha-community.org/