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

(-)a/Koha/Filter/MARC/EmbedItemsAvailability.pm (-1 / +1 lines)
Lines 90-96 sub _processrecord { Link Here
90
    else {
90
    else {
91
        # no field, create one
91
        # no field, create one
92
        $destination_field = MARC::Field->new( '999', '', '', x => $not_onloan_items );
92
        $destination_field = MARC::Field->new( '999', '', '', x => $not_onloan_items );
93
        $record->append_fields([$destination_field]);
93
        $record->append_fields($destination_field);
94
    }
94
    }
95
95
96
    return $record;
96
    return $record;
(-)a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t (-3 / +2 lines)
Lines 142-151 subtest 'EmbedItemsAvailability tests' => sub { Link Here
142
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
142
    is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' );
143
143
144
    $record = GetMarcBiblio($biblionumber);
144
    $record = GetMarcBiblio($biblionumber);
145
    ok( !defined $record->field('999')->subfield('x'), q{The record doesn't originally contain 999$x} );
145
    ok( !defined $record->subfield('999', 'x'), q{The record doesn't originally contain 999$x} );
146
    # Apply filter
146
    # Apply filter
147
    $processor->process($record);
147
    $processor->process($record);
148
    is($record->field('999')->subfield('x'), 1, 'There is only one item with undef onloan');
148
    is($record->subfield('999', 'x'), 1, 'There is only one item with undef onloan');
149
149
150
    $schema->storage->txn_rollback();
150
    $schema->storage->txn_rollback();
151
};
151
};
152
- 

Return to bug 18579