Skip to content

Commit

Permalink
Address improvements:
Browse files Browse the repository at this point in the history
Remove trialing and leading white space
Remove existing commas before replacing \r\n
  • Loading branch information
ammopt committed Aug 1, 2024
1 parent e755400 commit f3f8cde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Koha/Plugin/Com/PTFSEurope/HLISD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ sub harvest_libraries {
next;
}

# Replace '\r\n' with ', '
my $address = $library->{attributes}->{ $self->get_HLISD_library_field('branchaddress1') };
$address =~ s/,//g;

my @address_split = split( /\r\n/, $address );
my $final_address = join( ', ', @address_split );
my @address_lines = map { $_ =~ s/^\s+|\s+$//gr } @address_split;

my $final_address = join( ', ', @address_lines );

$self->debug_msg( sprintf( "Importing %s", $library->{id} ) );
my $library = Koha::Library->new(
Expand Down

0 comments on commit f3f8cde

Please sign in to comment.