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

(-)a/Koha/Exporter/Record.pm (-70 / +66 lines)
Lines 5-11 use MARC::File::XML; Link Here
5
use MARC::File::USMARC;
5
use MARC::File::USMARC;
6
6
7
use C4::AuthoritiesMarc;
7
use C4::AuthoritiesMarc;
8
use C4::Biblio qw( GetMarcFromKohaField );
8
use C4::Biblio  qw( GetMarcFromKohaField );
9
use C4::Charset qw( StripNonXmlChars );
9
use C4::Charset qw( StripNonXmlChars );
10
use C4::Record;
10
use C4::Record;
11
use Koha::Biblios;
11
use Koha::Biblios;
Lines 34-43 sub _get_record_for_export { Link Here
34
    } elsif ( $record_type eq 'deleted_bibs' ) {
34
    } elsif ( $record_type eq 'deleted_bibs' ) {
35
        $record = _get_deleted_biblio_for_export( { %$params, biblionumber => $record_id } );
35
        $record = _get_deleted_biblio_for_export( { %$params, biblionumber => $record_id } );
36
    } else {
36
    } else {
37
        Koha::Logger->get->warn( "Record type $record_type not supported." );
37
        Koha::Logger->get->warn("Record type $record_type not supported.");
38
    }
38
    }
39
    if ( !$record ) {
39
    if ( !$record ) {
40
        Koha::Logger->get->warn( "Record $record_id with record type $record_type could not be exported." );
40
        Koha::Logger->get->warn("Record $record_id with record type $record_type could not be exported.");
41
        return;
41
        return;
42
    }
42
    }
43
43
Lines 58-89 sub _get_record_for_export { Link Here
58
        },
58
        },
59
    );
59
    );
60
    if ($conditions) {
60
    if ($conditions) {
61
        foreach my $condition (@{$conditions}) {
61
        foreach my $condition ( @{$conditions} ) {
62
            my ($field_tag, $subfield, $operator, $match_value) = @{$condition};
62
            my ( $field_tag, $subfield, $operator, $match_value ) = @{$condition};
63
            my @fields = $record->field($field_tag);
63
            my @fields    = $record->field($field_tag);
64
            my $no_target = 0;
64
            my $no_target = 0;
65
65
66
            if (!@fields) {
66
            if ( !@fields ) {
67
                $no_target = 1;
67
                $no_target = 1;
68
            }
68
            } else {
69
            else {
69
                if ( $operator eq '?' ) {
70
                if ($operator eq '?') {
71
                    return unless any { $subfield ? $_->subfield($subfield) : $_->data() } @fields;
70
                    return unless any { $subfield ? $_->subfield($subfield) : $_->data() } @fields;
72
                } elsif ($operator eq '!?') {
71
                } elsif ( $operator eq '!?' ) {
73
                    return if any { $subfield ? $_->subfield($subfield) : $_->data() } @fields;
72
                    return if any { $subfield ? $_->subfield($subfield) : $_->data() } @fields;
74
                } else {
73
                } else {
75
                    my $op;
74
                    my $op;
76
                    if (exists $operators{$operator}) {
75
                    if ( exists $operators{$operator} ) {
77
                        $op = $operators{$operator};
76
                        $op = $operators{$operator};
78
                    } else {
77
                    } else {
79
                        die("Invalid operator: $op");
78
                        die("Invalid operator: $op");
80
                    }
79
                    }
81
                    my @target_values = map { $subfield ? $_->subfield($subfield) : ($_->data()) } @fields;
80
                    my @target_values = map { $subfield ? $_->subfield($subfield) : ( $_->data() ) } @fields;
82
                    if (!@target_values) {
81
                    if ( !@target_values ) {
83
                        $no_target = 1;
82
                        $no_target = 1;
84
                    }
83
                    } else {
85
                    else {
84
                        return unless all { $op->( $_, $match_value ) } @target_values;
86
                        return unless all { $op->($_, $match_value) } @target_values;
87
                    }
85
                    }
88
                }
86
                }
89
            }
87
            }
Lines 115-145 sub _get_record_for_export { Link Here
115
}
113
}
116
114
117
sub _get_deleted_biblio_for_export {
115
sub _get_deleted_biblio_for_export {
118
    my ($params)           = @_;
116
    my ($params) = @_;
119
    my $biblionumber = $params->{biblionumber};
117
    my $biblionumber = $params->{biblionumber};
118
120
    # Creating schema is expensive, allow caller to
119
    # Creating schema is expensive, allow caller to
121
    # pass it so don't have to recreate for each call
120
    # pass it so don't have to recreate for each call
122
    my $resultset = $params->{resultset} || Koha::Database->new()
121
    my $resultset       = $params->{resultset} || Koha::Database->new()->schema()->resultset('DeletedbiblioMetadata');
123
        ->schema()
122
    my $marc_flavour    = C4::Context->preference('marcflavour');
124
        ->resultset('DeletedbiblioMetadata');
123
    my $biblio_metadata = $resultset->find(
125
    my $marc_flavour = C4::Context->preference('marcflavour');
124
        {
126
    my $biblio_metadata = $resultset->find({
125
            'biblionumber' => $biblionumber,
127
        'biblionumber' => $biblionumber,
126
            'format'       => 'marcxml',
128
        'format' => 'marcxml',
127
            'schema'       => $marc_flavour
129
        'schema' => $marc_flavour
128
        }
130
    });
129
    );
131
    my $marc_xml = $biblio_metadata->metadata;
130
    my $marc_xml = $biblio_metadata->metadata;
132
    $marc_xml = StripNonXmlChars($marc_xml);
131
    $marc_xml = StripNonXmlChars($marc_xml);
133
132
134
    my $record = eval {
133
    my $record = eval { MARC::Record::new_from_xml( $marc_xml, 'UTF-8', $marc_flavour ) };
135
        MARC::Record::new_from_xml($marc_xml, 'UTF-8', $marc_flavour)
134
    if ( !$record ) {
136
    };
135
        Koha::Logger->get->warn("Failed to load MARCXML for deleted biblio with biblionumber \"$biblionumber\": $@");
137
    if (!$record) {
138
        Koha::Logger->get->warn(
139
            "Failed to load MARCXML for deleted biblio with biblionumber \"$biblionumber\": $@"
140
        );
141
        return;
136
        return;
142
    }
137
    }
138
143
    # Set deleted flag (record status, position 05)
139
    # Set deleted flag (record status, position 05)
144
    my $leader = $record->leader;
140
    my $leader = $record->leader;
145
    substr $leader, 5, 1, 'd';
141
    substr $leader, 5, 1, 'd';
Lines 148-155 sub _get_deleted_biblio_for_export { Link Here
148
}
144
}
149
145
150
sub _get_authority_for_export {
146
sub _get_authority_for_export {
151
    my ($params) = @_;
147
    my ($params)  = @_;
152
    my $authid = $params->{authid} || return;
148
    my $authid    = $params->{authid} || return;
153
    my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
149
    my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
154
    return unless $authority;
150
    return unless $authority;
155
    return $authority->record;
151
    return $authority->record;
Lines 166-175 sub _get_biblio_for_export { Link Here
166
    my $biblio = Koha::Biblios->find($biblionumber);
162
    my $biblio = Koha::Biblios->find($biblionumber);
167
    my $record = eval { $biblio->metadata->record };
163
    my $record = eval { $biblio->metadata->record };
168
164
169
    if (!$record) {
165
    if ( !$record ) {
170
        Koha::Logger->get->warn(
166
        Koha::Logger->get->warn("Failed to load MARCXML for biblio with biblionumber \"$biblionumber\": $@");
171
            "Failed to load MARCXML for biblio with biblionumber \"$biblionumber\": $@"
172
        );
173
        return;
167
        return;
174
    }
168
    }
175
169
Lines 184-195 sub _get_biblio_for_export { Link Here
184
                record       => $record,
178
                record       => $record,
185
                embed_items  => 1,
179
                embed_items  => 1,
186
                biblionumber => $biblionumber,
180
                biblionumber => $biblionumber,
187
                itemnumbers => $itemnumbers,
181
                itemnumbers  => $itemnumbers,
188
            }
182
            }
189
        );
183
        );
190
        if ($only_export_items_for_branches && @$only_export_items_for_branches) {
184
        if ( $only_export_items_for_branches && @$only_export_items_for_branches ) {
191
            my %export_items_for_branches = map { $_ => 1 } @$only_export_items_for_branches;
185
            my %export_items_for_branches = map { $_ => 1 } @$only_export_items_for_branches;
192
            my ( $homebranchfield, $homebranchsubfield ) = GetMarcFromKohaField( 'items.homebranch' );
186
            my ( $homebranchfield, $homebranchsubfield ) = GetMarcFromKohaField('items.homebranch');
193
187
194
            for my $itemfield ( $record->field($homebranchfield) ) {
188
            for my $itemfield ( $record->field($homebranchfield) ) {
195
                my $homebranch = $itemfield->subfield($homebranchsubfield);
189
                my $homebranch = $itemfield->subfield($homebranchsubfield);
Lines 206-212 sub export { Link Here
206
    my ($params) = @_;
200
    my ($params) = @_;
207
201
208
    my $record_type        = $params->{record_type};
202
    my $record_type        = $params->{record_type};
209
    my $record_ids         = $params->{record_ids} || [];
203
    my $record_ids         = $params->{record_ids}         || [];
210
    my $deleted_record_ids = $params->{deleted_record_ids} || [];
204
    my $deleted_record_ids = $params->{deleted_record_ids} || [];
211
    my $format             = $params->{format};
205
    my $format             = $params->{format};
212
    my $itemnumbers        = $params->{itemnumbers} || [];    # Does not make sense with record_type eq auths
206
    my $itemnumbers        = $params->{itemnumbers} || [];    # Does not make sense with record_type eq auths
Lines 215-228 sub export { Link Here
215
    my $csv_profile_id     = $params->{csv_profile_id};
209
    my $csv_profile_id     = $params->{csv_profile_id};
216
    my $output_filepath    = $params->{output_filepath};
210
    my $output_filepath    = $params->{output_filepath};
217
211
218
    if( !$record_type ) {
212
    if ( !$record_type ) {
219
        Koha::Logger->get->warn( "No record_type given." );
213
        Koha::Logger->get->warn("No record_type given.");
220
        return;
214
        return;
221
    }
215
    }
222
    return unless @{$record_ids} || @{$deleted_record_ids} && $format ne 'csv';
216
    return unless @{$record_ids} || @{$deleted_record_ids} && $format ne 'csv';
223
217
224
    my $fh;
218
    my $fh;
225
    if ( $output_filepath ) {
219
    if ($output_filepath) {
226
        open $fh, '>', $output_filepath or die "Cannot open file $output_filepath ($!)";
220
        open $fh, '>', $output_filepath or die "Cannot open file $output_filepath ($!)";
227
        select $fh;
221
        select $fh;
228
        binmode $fh, ':encoding(UTF-8)' unless $format eq 'csv';
222
        binmode $fh, ':encoding(UTF-8)' unless $format eq 'csv';
Lines 230-286 sub export { Link Here
230
        binmode STDOUT, ':encoding(UTF-8)' unless $format eq 'csv';
224
        binmode STDOUT, ':encoding(UTF-8)' unless $format eq 'csv';
231
    }
225
    }
232
226
233
    if ($format eq 'xml' || $format eq 'iso2709') {
227
    if ( $format eq 'xml' || $format eq 'iso2709' ) {
234
        my @records;
228
        my @records;
235
        @records = map {
229
        @records = map {
236
            my $record = _get_record_for_export({ %{$params}, record_id => $_ });
230
            my $record = _get_record_for_export( { %{$params}, record_id => $_ } );
237
            $record ? $record : ();
231
            $record ? $record : ();
238
        } @{$record_ids};
232
        } @{$record_ids};
239
233
240
        my @deleted_records;
234
        my @deleted_records;
241
        if (@{$deleted_record_ids}) {
235
        if ( @{$deleted_record_ids} ) {
242
            my $resultset = Koha::Database->new()
236
            my $resultset = Koha::Database->new()->schema()->resultset('DeletedbiblioMetadata');
243
                ->schema()
244
                ->resultset('DeletedbiblioMetadata');
245
237
246
            @deleted_records = map {
238
            @deleted_records = map {
247
                my $record = _get_record_for_export({
239
                my $record = _get_record_for_export(
248
                    %{$params},
240
                    {
249
                    record_type => 'deleted_bibs',
241
                        %{$params},
250
                    record_id => $_,
242
                        record_type => 'deleted_bibs',
251
                    resultset => $resultset
243
                        record_id   => $_,
252
                });
244
                        resultset   => $resultset
245
                    }
246
                );
253
                $record ? $record : ();
247
                $record ? $record : ();
254
            } @{$deleted_record_ids};
248
            } @{$deleted_record_ids};
255
        }
249
        }
256
        if ( $format eq 'iso2709' ) {
250
        if ( $format eq 'iso2709' ) {
257
            my $encoding_validator = sub {
251
            my $encoding_validator = sub {
258
                my ($record, $record_type) = @_;
252
                my ( $record, $record_type ) = @_;
259
                my $errorcount_on_decode = eval { scalar(MARC::File::USMARC->decode($record->as_usmarc)->warnings()) };
253
                my $errorcount_on_decode =
260
                if ($errorcount_on_decode || $@) {
254
                    eval { scalar( MARC::File::USMARC->decode( $record->as_usmarc )->warnings() ) };
261
                    my ($id_tag, $id_subfield) = GetMarcFromKohaField('biblio.biblionumber', '');
255
                if ( $errorcount_on_decode || $@ ) {
262
                    my $record_id = $record->subfield($id_tag, $id_subfield);
256
                    my ( $id_tag, $id_subfield ) = GetMarcFromKohaField( 'biblio.biblionumber', '' );
263
                    my $msg = "$record_type $record_id could not be USMARC decoded/encoded. " . ($@ // '');
257
                    my $record_id = $record->subfield( $id_tag, $id_subfield );
258
                    my $msg       = "$record_type $record_id could not be USMARC decoded/encoded. " . ( $@ // '' );
264
                    chomp $msg;
259
                    chomp $msg;
265
                    Koha::Logger->get->warn($msg);
260
                    Koha::Logger->get->warn($msg);
266
                    return 0;
261
                    return 0;
267
                }
262
                }
268
                return 1;
263
                return 1;
269
            };
264
            };
270
            for my $record (grep { $encoding_validator->($_, 'Record') } @records) {
265
            for my $record ( grep { $encoding_validator->( $_, 'Record' ) } @records ) {
271
                print $record->as_usmarc();
266
                print $record->as_usmarc();
272
            }
267
            }
273
            if (@deleted_records) {
268
            if (@deleted_records) {
274
                for my $deleted_record (grep { $encoding_validator->($_, 'Deleted record') } @deleted_records) {
269
                for my $deleted_record ( grep { $encoding_validator->( $_, 'Deleted record' ) } @deleted_records ) {
275
                    print $deleted_record->as_usmarc();
270
                    print $deleted_record->as_usmarc();
276
                }
271
                }
277
            }
272
            }
278
        } elsif ( $format eq 'xml' ) {
273
        } elsif ( $format eq 'xml' ) {
279
            my $marcflavour = C4::Context->preference("marcflavour");
274
            my $marcflavour = C4::Context->preference("marcflavour");
280
            MARC::File::XML->default_record_format( ( $marcflavour eq 'UNIMARC' && $record_type eq 'auths' ) ? 'UNIMARCAUTH' : $marcflavour );
275
            MARC::File::XML->default_record_format(
276
                ( $marcflavour eq 'UNIMARC' && $record_type eq 'auths' ) ? 'UNIMARCAUTH' : $marcflavour );
281
            print MARC::File::XML::header();
277
            print MARC::File::XML::header();
282
            print "\n";
278
            print "\n";
283
            for my $record (@records, @deleted_records) {
279
            for my $record ( @records, @deleted_records ) {
284
                print MARC::File::XML::record($record);
280
                print MARC::File::XML::record($record);
285
                print "\n";
281
                print "\n";
286
            }
282
            }
Lines 289-295 sub export { Link Here
289
        }
285
        }
290
    } elsif ( $format eq 'csv' ) {
286
    } elsif ( $format eq 'csv' ) {
291
        die 'There is no valid csv profile defined for this export'
287
        die 'There is no valid csv profile defined for this export'
292
            unless Koha::CsvProfiles->find( $csv_profile_id );
288
            unless Koha::CsvProfiles->find($csv_profile_id);
293
        print marc2csv( $record_ids, $csv_profile_id, $itemnumbers );
289
        print marc2csv( $record_ids, $csv_profile_id, $itemnumbers );
294
    }
290
    }
295
    close $fh if $output_filepath;
291
    close $fh if $output_filepath;
(-)a/misc/export_records.pl (-12 / +18 lines)
Lines 107-120 $record_type ||= 'bibs'; Link Here
107
# Retrocompatibility for the format parameter
107
# Retrocompatibility for the format parameter
108
$output_format = 'iso2709' if $output_format eq 'marc';
108
$output_format = 'iso2709' if $output_format eq 'marc';
109
109
110
if ($include_deleted || $deleted_only) {
110
if ( $include_deleted || $deleted_only ) {
111
    if ($record_type ne 'bibs') {
111
    if ( $record_type ne 'bibs' ) {
112
        pod2usage(q|Option "--include_deleted" or "--deleted_only" can only be used with "--record-type=bibs"|);
112
        pod2usage(q|Option "--include_deleted" or "--deleted_only" can only be used with "--record-type=bibs"|);
113
    }
113
    }
114
    if ($output_format eq 'csv') {
114
    if ( $output_format eq 'csv' ) {
115
        pod2usage(q|Option "--include_deleted" or "--deleted_only" cannot be used with "--format=csv"|);
115
        pod2usage(q|Option "--include_deleted" or "--deleted_only" cannot be used with "--format=csv"|);
116
    }
116
    }
117
    if (!$timestamp) {
117
    if ( !$timestamp ) {
118
        pod2usage(q|Option "--include_deleted" or "--deleted_only" must be combined with "--date"|);
118
        pod2usage(q|Option "--include_deleted" or "--deleted_only" must be combined with "--date"|);
119
    }
119
    }
120
}
120
}
Lines 205-213 if ( $record_type eq 'bibs' ) { Link Here
205
        }
205
        }
206
    } elsif ($timestamp) {
206
    } elsif ($timestamp) {
207
        unless ($deleted_only) {
207
        unless ($deleted_only) {
208
            if (!$dont_export_items) {
208
            if ( !$dont_export_items ) {
209
                push @record_ids, $_->{biblionumber} for @{
209
                push @record_ids, $_->{biblionumber} for @{
210
                    $dbh->selectall_arrayref(q| (
210
                    $dbh->selectall_arrayref(
211
                        q| (
211
                        SELECT biblio_metadata.biblionumber
212
                        SELECT biblio_metadata.biblionumber
212
                        FROM biblio_metadata
213
                        FROM biblio_metadata
213
                          LEFT JOIN items USING(biblionumber)
214
                          LEFT JOIN items USING(biblionumber)
Lines 219-243 if ( $record_type eq 'bibs' ) { Link Here
219
                          LEFT JOIN deleteditems USING(biblionumber)
220
                          LEFT JOIN deleteditems USING(biblionumber)
220
                        WHERE biblio_metadata.timestamp >= ?
221
                        WHERE biblio_metadata.timestamp >= ?
221
                          OR deleteditems.timestamp >= ?
222
                          OR deleteditems.timestamp >= ?
222
                    ) |, { Slice => {} }, ( $timestamp ) x 4 );
223
                    ) |, { Slice => {} }, ($timestamp) x 4
224
                    );
223
                };
225
                };
224
            } else {
226
            } else {
225
                push @record_ids, $_->{biblionumber} for @{
227
                push @record_ids, $_->{biblionumber} for @{
226
                    $dbh->selectall_arrayref(q| (
228
                    $dbh->selectall_arrayref(
229
                        q| (
227
                        SELECT biblio_metadata.biblionumber
230
                        SELECT biblio_metadata.biblionumber
228
                        FROM biblio_metadata
231
                        FROM biblio_metadata
229
                        WHERE biblio_metadata.timestamp >= ?
232
                        WHERE biblio_metadata.timestamp >= ?
230
                    ) |, { Slice => {} }, $timestamp );
233
                    ) |, { Slice => {} }, $timestamp
234
                    );
231
                };
235
                };
232
            }
236
            }
233
        }
237
        }
234
        if ($include_deleted || $deleted_only) {
238
        if ( $include_deleted || $deleted_only ) {
235
            push @deleted_record_ids, $_->{biblionumber} for @{
239
            push @deleted_record_ids, $_->{biblionumber} for @{
236
                $dbh->selectall_arrayref(q|
240
                $dbh->selectall_arrayref(
241
                    q|
237
                    SELECT `biblionumber`
242
                    SELECT `biblionumber`
238
                    FROM `deletedbiblio`
243
                    FROM `deletedbiblio`
239
                    WHERE `timestamp` >= ?
244
                    WHERE `timestamp` >= ?
240
                |, { Slice => {} }, $timestamp);
245
                |, { Slice => {} }, $timestamp
246
                );
241
            };
247
            };
242
        }
248
        }
243
    } else {
249
    } else {
(-)a/t/db_dependent/Exporter/Record.t (-10 / +12 lines)
Lines 79-88 if ($marcflavour eq 'UNIMARC') { Link Here
79
my $deleted_biblio = MARC::Record->new();
79
my $deleted_biblio = MARC::Record->new();
80
$deleted_biblio->leader('00136nam a22000617a 4500');
80
$deleted_biblio->leader('00136nam a22000617a 4500');
81
$deleted_biblio->append_fields(
81
$deleted_biblio->append_fields(
82
    MARC::Field->new('100', ' ', ' ', a => 'Chopra, Deepak'),
82
    MARC::Field->new( '100', ' ', ' ', a => 'Chopra, Deepak'),
83
    MARC::Field->new('245', ' ', ' ', a => 'The seven spiritual laws of success'),
83
    MARC::Field->new( $title_field_tag, ' ', ' ', a => 'The seven spiritual laws of success'),
84
);
84
);
85
my ($deleted_biblionumber) = AddBiblio($deleted_biblio, '');
85
my ($deleted_biblionumber) = AddBiblio( $deleted_biblio, '' );
86
DelBiblio($deleted_biblionumber);
86
DelBiblio($deleted_biblionumber);
87
87
88
my $bad_biblio = Koha::Biblio->new()->store();
88
my $bad_biblio = Koha::Biblio->new()->store();
Lines 164-172 subtest 'export xml' => sub { Link Here
164
    my $generated_xml_file = '/tmp/test_export.xml';
164
    my $generated_xml_file = '/tmp/test_export.xml';
165
    warning_like {
165
    warning_like {
166
        Koha::Exporter::Record::export(
166
        Koha::Exporter::Record::export(
167
            {   record_type        => 'bibs',
167
            {
168
                record_type        => 'bibs',
168
                record_ids         => [ $biblionumber_1, $bad_biblionumber, $biblionumber_2 ],
169
                record_ids         => [ $biblionumber_1, $bad_biblionumber, $biblionumber_2 ],
169
                deleted_record_ids => [ $deleted_biblionumber ],
170
                deleted_record_ids => [$deleted_biblionumber],
170
                format             => 'xml',
171
                format             => 'xml',
171
                output_filepath    => $generated_xml_file,
172
                output_filepath    => $generated_xml_file,
172
            }
173
            }
Lines 195-212 subtest 'export xml' => sub { Link Here
195
196
196
    # Leader has the expected value (and record status "d", length may have
197
    # Leader has the expected value (and record status "d", length may have
197
    # changed)
198
    # changed)
198
    ok( $deleted_record->leader =~ '\d{5}dam a22000617a 4500', 'Deleted record has the expected leader value' );
199
    ok( $deleted_record->leader =~ '\d{5}dam a22000\d{2}7a 4500', 'Deleted record has the expected leader value' );
199
};
200
};
200
201
201
subtest 'export iso2709' => sub {
202
subtest 'export iso2709' => sub {
202
    plan tests => 4;
203
    plan tests => 4;
203
    my $generated_mrc_file = '/tmp/test_export.mrc';
204
    my $generated_mrc_file = '/tmp/test_export.mrc';
205
204
    # Get all item infos
206
    # Get all item infos
205
    warning_like {
207
    warning_like {
206
        Koha::Exporter::Record::export(
208
        Koha::Exporter::Record::export(
207
            {   record_type        => 'bibs',
209
            {
210
                record_type        => 'bibs',
208
                record_ids         => [ $biblionumber_1, $bad_biblionumber, $biblionumber_2 ],
211
                record_ids         => [ $biblionumber_1, $bad_biblionumber, $biblionumber_2 ],
209
                deleted_record_ids => [ $deleted_biblionumber ],
212
                deleted_record_ids => [$deleted_biblionumber],
210
                format             => 'iso2709',
213
                format             => 'iso2709',
211
                output_filepath    => $generated_mrc_file,
214
                output_filepath    => $generated_mrc_file,
212
            }
215
            }
Lines 228-234 subtest 'export iso2709' => sub { Link Here
228
    my $deleted_record = $records[2];
231
    my $deleted_record = $records[2];
229
    # Leader has the expected value (and record status "d", length may have
232
    # Leader has the expected value (and record status "d", length may have
230
    # changed)
233
    # changed)
231
    ok( $deleted_record->leader =~ '\d{5}dam a22000617a 4500', 'Deleted record has the expected leader value' );
234
    ok( $deleted_record->leader =~ '\d{5}dam a22000\d{2}7a 4500', 'Deleted record has the expected leader value' );
232
};
235
};
233
236
234
subtest 'export without record_type' => sub {
237
subtest 'export without record_type' => sub {
235
- 

Return to bug 20551