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

(-)a/C4/Biblio.pm (-5 / +4 lines)
Lines 101-107 use C4::Debug; Link Here
101
use Koha::Caches;
101
use Koha::Caches;
102
use Koha::Authority::Types;
102
use Koha::Authority::Types;
103
use Koha::Acquisition::Currencies;
103
use Koha::Acquisition::Currencies;
104
use Koha::Biblio::Metadata;
105
use Koha::Biblio::Metadatas;
104
use Koha::Biblio::Metadatas;
106
use Koha::Holds;
105
use Koha::Holds;
107
use Koha::ItemTypes;
106
use Koha::ItemTypes;
Lines 1220-1226 sub GetXmlBiblio { Link Here
1220
        FROM biblio_metadata
1219
        FROM biblio_metadata
1221
        WHERE biblionumber=?
1220
        WHERE biblionumber=?
1222
            AND format='marcxml'
1221
            AND format='marcxml'
1223
            AND marcflavour=?
1222
            AND `schema`=?
1224
    |, undef, $biblionumber, C4::Context->preference('marcflavour')
1223
    |, undef, $biblionumber, C4::Context->preference('marcflavour')
1225
    );
1224
    );
1226
    return $marcxml;
1225
    return $marcxml;
Lines 3248-3255 sub _koha_delete_biblio_metadata { Link Here
3248
    $schema->txn_do(
3247
    $schema->txn_do(
3249
        sub {
3248
        sub {
3250
            $dbh->do( q|
3249
            $dbh->do( q|
3251
                INSERT INTO deletedbiblio_metadata (biblionumber, format, marcflavour, metadata)
3250
                INSERT INTO deletedbiblio_metadata (biblionumber, format, `schema`, metadata)
3252
                SELECT biblionumber, format, marcflavour, metadata FROM biblio_metadata WHERE biblionumber=?
3251
                SELECT biblionumber, format, `schema`, metadata FROM biblio_metadata WHERE biblionumber=?
3253
            |,  undef, $biblionumber );
3252
            |,  undef, $biblionumber );
3254
            $dbh->do( q|DELETE FROM biblio_metadata WHERE biblionumber=?|,
3253
            $dbh->do( q|DELETE FROM biblio_metadata WHERE biblionumber=?|,
3255
                undef, $biblionumber );
3254
                undef, $biblionumber );
Lines 3321-3327 sub ModBiblioMarc { Link Here
3321
    my $metadata = {
3320
    my $metadata = {
3322
        biblionumber => $biblionumber,
3321
        biblionumber => $biblionumber,
3323
        format       => 'marcxml',
3322
        format       => 'marcxml',
3324
        marcflavour  => C4::Context->preference('marcflavour'),
3323
        schema       => C4::Context->preference('marcflavour'),
3325
    };
3324
    };
3326
    $record->as_usmarc; # Bug 20126/10455 This triggers field length calculation
3325
    $record->as_usmarc; # Bug 20126/10455 This triggers field length calculation
3327
3326
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 2312-2318 sub SearchItems { Link Here
2312
        $query .= qq{ AND $where_str };
2312
        $query .= qq{ AND $where_str };
2313
    }
2313
    }
2314
2314
2315
    $query .= q{ AND biblio_metadata.format = 'marcxml' AND biblio_metadata.marcflavour = ? };
2315
    $query .= q{ AND biblio_metadata.format = 'marcxml' AND biblio_metadata.schema = ? };
2316
    push @where_args, C4::Context->preference('marcflavour');
2316
    push @where_args, C4::Context->preference('marcflavour');
2317
2317
2318
    my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns;
2318
    my @columns = Koha::Database->new()->schema()->resultset('Item')->result_source->columns;
(-)a/misc/cronjobs/delete_records_via_leader.pl (-1 / +1 lines)
Lines 79-85 This script has the following parameters : Link Here
79
79
80
my @metadatas =    # Should be replaced by a call to C4::Search on zebra index
80
my @metadatas =    # Should be replaced by a call to C4::Search on zebra index
81
                   # Record-status when bug 15537 will be pushed
81
                   # Record-status when bug 15537 will be pushed
82
  Koha::Biblio::Metadatas->search( { format => 'marcxml', marcflavour => C4::Context->preference('marcflavour'), metadata => { LIKE => '%<leader>_____d%' } } );
82
  Koha::Biblio::Metadatas->search( { format => 'marcxml', schema => C4::Context->preference('marcflavour'), metadata => { LIKE => '%<leader>_____d%' } } );
83
83
84
my $total_records_count   = @metadatas;
84
my $total_records_count   = @metadatas;
85
my $deleted_records_count = 0;
85
my $deleted_records_count = 0;
(-)a/misc/maintenance/sanitize_records.pl (-1 / +1 lines)
Lines 152-158 sub biblios_to_sanitize { Link Here
152
        SELECT biblionumber
152
        SELECT biblionumber
153
        FROM biblio_metadata
153
        FROM biblio_metadata
154
        WHERE format = 'marcxml'
154
        WHERE format = 'marcxml'
155
            AND marcflavour = ?
155
            AND `schema` = ?
156
            AND metadata LIKE "%&amp;amp;%"
156
            AND metadata LIKE "%&amp;amp;%"
157
        };
157
        };
158
    return @{ $dbh->selectcol_arrayref( $query, { Slice => {} }, C4::Context->preference('marcflavour') ) };
158
    return @{ $dbh->selectcol_arrayref( $query, { Slice => {} }, C4::Context->preference('marcflavour') ) };
(-)a/misc/migration_tools/build_oai_sets.pl (-1 / +1 lines)
Lines 73-79 my $query = qq{ Link Here
73
    SELECT biblionumber, metadata
73
    SELECT biblionumber, metadata
74
    FROM biblio_metadata
74
    FROM biblio_metadata
75
    WHERE format='marcxml'
75
    WHERE format='marcxml'
76
    AND marcflavour = ?
76
    AND  `schema` = ?
77
};
77
};
78
if($length) {
78
if($length) {
79
    $query .= "LIMIT $length";
79
    $query .= "LIMIT $length";
(-)a/misc/migration_tools/switch_marc21_series_info.pl (-2 / +2 lines)
Lines 63-69 my $count_sth = $dbh->prepare( Link Here
63
    SELECT COUNT(biblionumber)
63
    SELECT COUNT(biblionumber)
64
    FROM biblio_metadata
64
    FROM biblio_metadata
65
    WHERE format='marcxml'
65
    WHERE format='marcxml'
66
        AND marcflavour=?
66
        AND `schema`=?
67
        AND (
67
        AND (
68
            ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="a"]')
68
            ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="a"]')
69
                OR ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="v"]')
69
                OR ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="v"]')
Lines 79-85 my $bibs_sth = $dbh->prepare( Link Here
79
    SELECT biblionumber
79
    SELECT biblionumber
80
    FROM biblio_metadata
80
    FROM biblio_metadata
81
    WHERE format='marcxml'
81
    WHERE format='marcxml'
82
        AND marcflavour=?
82
        AND `schema`=?
83
        AND (
83
        AND (
84
            ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="a"]')
84
            ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="a"]')
85
                OR ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="v"]')
85
                OR ExtractValue(metadata,'//datafield[@tag="440"]/subfield[@code="v"]')
(-)a/t/db_dependent/Exporter/Record.t (-2 / +2 lines)
Lines 34-40 use Koha::Database; Link Here
34
use Koha::Biblio;
34
use Koha::Biblio;
35
use Koha::Biblioitem;
35
use Koha::Biblioitem;
36
use Koha::Exporter::Record;
36
use Koha::Exporter::Record;
37
use Koha::Biblio::Metadata;
37
use Koha::Biblio::Metadatas;
38
38
39
my $schema  = Koha::Database->new->schema;
39
my $schema  = Koha::Database->new->schema;
40
$schema->storage->txn_begin;
40
$schema->storage->txn_begin;
Lines 59-65 $biblio_2->append_fields( Link Here
59
my ($biblionumber_2, $biblioitemnumber_2) = AddBiblio($biblio_2, '');
59
my ($biblionumber_2, $biblioitemnumber_2) = AddBiblio($biblio_2, '');
60
60
61
my $bad_biblio = Koha::Biblio->new()->store();
61
my $bad_biblio = Koha::Biblio->new()->store();
62
Koha::Biblio::Metadata->new( { biblionumber => $bad_biblio->id, format => 'marcxml', metadata => 'something wrong', marcflavour => C4::Context->preference('marcflavour') } )->store();
62
Koha::Biblio::Metadata->new( { biblionumber => $bad_biblio->id, format => 'marcxml', metadata => 'something wrong', schema => C4::Context->preference('marcflavour') } )->store();
63
my $bad_biblionumber = $bad_biblio->id;
63
my $bad_biblionumber = $bad_biblio->id;
64
64
65
my $builder = t::lib::TestBuilder->new;
65
my $builder = t::lib::TestBuilder->new;
(-)a/t/db_dependent/OAI/Server.t (-2 / +1 lines)
Lines 362-368 subtest 'Bug 19725: OAI-PMH ListRecords and ListIdentifiers should use biblio_me Link Here
362
    $record->append_fields(MARC::Field->new(999, '', '', z => '_'));
362
    $record->append_fields(MARC::Field->new(999, '', '', z => '_'));
363
    ModBiblio( $record, $biblionumber );
363
    ModBiblio( $record, $biblionumber );
364
    my $from_dt = dt_from_string(
364
    my $from_dt = dt_from_string(
365
        Koha::Biblio::Metadatas->find({ biblionumber => $biblionumber, format => 'marcxml', marcflavour => 'MARC21' })->timestamp
365
        Koha::Biblio::Metadatas->find({ biblionumber => $biblionumber, format => 'marcxml', schema => 'MARC21' })->timestamp
366
    );
366
    );
367
    my $from = $from_dt->ymd . 'T' . $from_dt->hms . 'Z';
367
    my $from = $from_dt->ymd . 'T' . $from_dt->hms . 'Z';
368
    $oaidc[0]->{header}->{datestamp} = $from;
368
    $oaidc[0]->{header}->{datestamp} = $from;
369
- 

Return to bug 22155