[Koha] Koha - Trouble loading patron files NOT solved

Linda Culberson lculber at mdah.state.ms.us
Tue Nov 9 06:10:30 NZDT 2010


  Okay, I've been trying every which way including Ian's, and I can get 
my patrons, but am still not getting my patron_attributes. Once again 
this is a fresh install of 3.2 and a new database. Although I did dump 
my data from 3.1, the patron files in our current system have been 
updated substantially, so I was trying a fresh load of the data using 
the Staff
Home › Tools › Import Patrons tool

The error in the /var/log/koha/koha-error_log is
import_borrowers.pl: Use of uninitialized value within @columns in 
pattern match (m//) at 
/usr/share/koha/intranet/cgi-bin/tools/import_borrowers.pl line 158

Here are those lines from import_borrowers.pl (hopefully with some context):
144 my @columns = $csv->fields();
145 if (! $status) {
146 push @missing_criticals, {badparse=>1, line=>$., lineraw=>$borrower 
line};
147 } elsif (@columns == @columnkeys) {
148 @borrower{@columnkeys} = @columns;
149 # MJR: try to fill blanks gracefully by using default values
150 foreach my $key (@criticals) {
151 if ($borrower{$key} !~ /\S/) {
152 $borrower{$key} = $defaults{$key};
153 }
154 }
155 } else {
156 # MJR: try to recover gracefully by using default values
157 foreach my $key (@columnkeys) {
158 if (defined($csvkeycol{$key}) and $columns[$csvkeycol{$key}] =~ /\S/) {
159 $borrower{$key} = $columns[$csvkeycol{$key}];

Once, again, thanks for any help and/or advice.

On 1:59 PM, Ian Bays wrote:
> Hi,
> Just to add a little detail:
> The header row I used does not have any quotes (single or double) and 
> ends like this:
> ,altcontactphone,smsalertnumber,patron_attributes
>
> In the actual borrower rows apart from the patron_attributes the only 
> fields I enclosed in quotes were those that had a comma or an 
> apostrophe. The rest have no quotes. The quotes I used were double 
> quotes. Some examples snipped that do not invade privacy:
>
> ...,"O'Connor",Anna,,,,,,...
> ...,Cosham,Portsmouth,"Hants, PO6 2PZ",,...
> ...,Sevenoaks,TN14 7AG,...
> ...,EXP,23/11/1999,,,,0,,,,,NOTE: LEFT 2000,,,...
> ...,,"SID:O'S98001234","DEPARTMENT:C&F","COURSE:M80"
>
> So the patron_attributes appear as separate "fields" on the end and 
> are not grouped in quotes as a single item.
>
> I hope that helps...
> Ian
>
> On 08/11/2010 14:52, Ian Bays wrote:
>> Hi Linda,
>> On recent borrower import using the staff-client interface I found that
>> the following formatting worked for patron-attributes:
>>
>> ,,,"SID:EVE99001234","COURSE:M7","DEPARTMENT:LIBRARY"
>>
>> Although the staff interface loader usually gives good diagnostics I
>> found there were some problems with data that failed silently (wish I
>> could remember which) so I now often prepare borrower data as sql for
>> loading mimicking the format of data from mysqldump.
>>
>> Ian
>>
>> On 08/11/2010 14:28, Linda Culberson wrote:
>>> Sorry, I just *thought* it was solved. The patrons loaded but the
>>> patron attributes did not. So there is still a problem.
>>>

-- 
Linda Culberson			lculber at mdah.state.ms.us
Archives and Records Services Division
Ms. Dept. of Archives&  History
P. O. Box 571
Jackson, MS 39205-0571
Telephone:  601/576-6873
Facsimile:  601/576-6824





More information about the Koha mailing list