View | Details | Raw Unified | Return to bug 14115
Collapse All | Expand All

(-)a/C4/Labels/Label.pm (-4 / +4 lines)
Lines 115-121 sub _get_text_fields { Link Here
115
    my $csv = Text::CSV_XS->new({allow_whitespace => 1});
115
    my $csv = Text::CSV_XS->new({allow_whitespace => 1});
116
    my $status = $csv->parse($format_string);
116
    my $status = $csv->parse($format_string);
117
    my @sorted_fields = map {{ 'code' => $_, desc => $_ }} 
117
    my @sorted_fields = map {{ 'code' => $_, desc => $_ }} 
118
                        map { $_ eq 'callnumber' ? 'itemcallnumber' : $_ } # see bug 5653
118
                        map { $_ && $_ eq 'callnumber' ? 'itemcallnumber' : $_ } # see bug 5653
119
                        $csv->fields();
119
                        $csv->fields();
120
    my $error = $csv->error_input();
120
    my $error = $csv->error_input();
121
    warn sprintf('Text field sort failed with this error: %s', $error) if $error;
121
    warn sprintf('Text field sort failed with this error: %s', $error) if $error;
Lines 129-138 sub _split_lccn { Link Here
129
    # lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996';
129
    # lccn examples: 'HE8700.7 .P6T44 1983', 'BS2545.E8 H39 1996';
130
    my @parts = Library::CallNumber::LC->new($lccn)->components();
130
    my @parts = Library::CallNumber::LC->new($lccn)->components();
131
    unless (scalar @parts && defined $parts[0])  {
131
    unless (scalar @parts && defined $parts[0])  {
132
        warn sprintf('regexp failed to match string: %s', $_);
132
        $debug and warn sprintf('regexp failed to match string: %s', $_);
133
        @parts = $_;     # if no match, just use the whole string.
133
        @parts = $_;     # if no match, just use the whole string.
134
    }
134
    }
135
    push @parts, split /\s+/, pop @parts;   # split the last piece into an arbitrary number of pieces at spaces
135
    my $LastPiece = pop @parts;
136
    push @parts, split /\s+/, $LastPiece if $LastPiece;   # split the last piece into an arbitrary number of pieces at spaces
136
    $debug and warn "split_lccn array: ", join(" | ", @parts), "\n";
137
    $debug and warn "split_lccn array: ", join(" | ", @parts), "\n";
137
    return @parts;
138
    return @parts;
138
}
139
}
139
- 

Return to bug 14115