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

(-)a/C4/ImportBatch.pm (-4 / +2 lines)
Lines 1656-1666 sub _update_biblio_fields { Link Here
1656
1656
1657
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1657
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1658
    my $dbh = C4::Context->dbh;
1658
    my $dbh = C4::Context->dbh;
1659
    # FIXME no controlnumber, originalsource
1659
    # FIXME no originalsource
1660
    # FIXME 2 - should regularize normalization of ISBN wherever it is done
1660
    # FIXME 2 - should regularize normalization of ISBN wherever it is done
1661
    $isbn =~ s/\(.*$//;
1661
    $isbn = C4::Koha::GetNormalizedISBN($isbn);
1662
    $isbn =~ tr/ -_//;
1663
    $isbn = uc $isbn;
1664
    my $sth = $dbh->prepare("UPDATE import_biblios SET title = ?, author = ?, isbn = ?, issn = ?
1662
    my $sth = $dbh->prepare("UPDATE import_biblios SET title = ?, author = ?, isbn = ?, issn = ?
1665
                             WHERE  import_record_id = ?");
1663
                             WHERE  import_record_id = ?");
1666
    $sth->execute($title, $author, $isbn, $issn, $import_record_id);
1664
    $sth->execute($title, $author, $isbn, $issn, $import_record_id);
(-)a/Koha/MetaSearcher.pm (-2 / +10 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use base 'Class::Accessor';
22
use base 'Class::Accessor';
23
23
24
use C4::Charset qw( MarcToUTF8Record );
24
use C4::Charset qw( MarcToUTF8Record );
25
use C4::Koha qw(); # Purely for GetNormalizedISBN
25
use C4::Search qw(); # Purely for new_record_from_zebra
26
use C4::Search qw(); # Purely for new_record_from_zebra
26
use DBIx::Class::ResultClass::HashRefInflator;
27
use DBIx::Class::ResultClass::HashRefInflator;
27
use IO::Select;
28
use IO::Select;
Lines 238-245 sub _db_query_get_match_conditions { Link Here
238
    if ( $value =~ /\*/ ) {
239
    if ( $value =~ /\*/ ) {
239
        $value =~ s/\*/%/;
240
        $value =~ s/\*/%/;
240
        return { -like => $value };
241
        return { -like => $value };
242
    } elsif ( $index eq 'isbn' ) {
243
        return C4::Koha::GetNormalizedISBN($value) || $value;
241
    } elsif ( $_batch_db_text_columns->{$index} ) {
244
    } elsif ( $_batch_db_text_columns->{$index} ) {
242
        return map +{ -regexp => '[[:<:]]' . $_ . '[[:>:]]' }, split( /\s+/, $value );
245
        my $stripped_value = $value;
246
        $stripped_value =~ s/[^\w ]//g;
247
        $stripped_value =~ s/^ +| +$//g;
248
249
        return $value if ( !$stripped_value );
250
251
        return map +{ -regexp => '[[:<:]]' . $_ . '[[:>:]]' }, split( /\s+/, $stripped_value );
243
    } else {
252
    } else {
244
        return $value;
253
        return $value;
245
    }
254
    }
246
- 

Return to bug 18823