https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44282 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212593&action=edit Bug 44282: Import patrons: always read columns by the header row Bug 44282: Import patrons: always read columns by the header row When a line had exactly as many fields as there are importable columns, import_patrons assigned the values by position and ignored the header row. A file with every column in another order was imported into the wrong fields with no warning (surname and firstname swapped, for example), and with ExtendedPatronAttributes on the line died in generate_patron_attributes because the empty patron_attributes cell had become undef. The header row now decides for every line, as it already did for lines that leave a column out. Test plan: 1. prove t/db_dependent/Koha/Patrons/Import.t Without the patch the new subtest fails: surname and firstname are swapped with ExtendedPatronAttributes off, and the patron is not imported with it on. With the patch it passes. 2. Tools > Import patrons: download the starter CSV, swap the surname and firstname headers, add one patron (surname "Headerorder", firstname "Swapped", a card number, library and category), import. Without the patch the names are swapped; with it they are right. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.