Bug 38271: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f68688b58)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5d0a019756)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Kyle M Hall 2024-10-25 09:06:11 -04:00 committed by Fridolin Somers
parent 2606b4ee2e
commit 01d0ea0ef3
2 changed files with 10 additions and 10 deletions

View File

@ -1222,14 +1222,14 @@ sub _create_item_from_quote {
}
sub _handle_008_field {
my ( $bib_record ) = @_;
my ($bib_record) = @_;
if ( !$bib_record->field('008') ) {
my $default008 = biblio_008();
$bib_record->insert_fields_ordered( MARC::Field->new('008', $default008));
$bib_record->insert_fields_ordered( MARC::Field->new( '008', $default008 ) );
}
return $bib_record
return $bib_record;
}
1;

View File

@ -130,7 +130,7 @@ subtest '_handle_008_field' => sub {
$schema->storage->txn_begin;
# Add our test quote file to the database for testing against
# Add our test quote file to the database for testing against
my $account = $builder->build(
{
source => 'VendorEdiAccount',
@ -190,16 +190,16 @@ subtest '_handle_008_field' => sub {
# Tests for generated basket for passed quote file
my $baskets = Koha::Acquisition::Baskets->search( { booksellerid => $account->{vendor_id} } );
my $basket = $baskets->next;
my $basket = $baskets->next;
my $orders = $basket->orders;
my $order = $orders->next;
my $order = $orders->next;
my $biblio = $order->biblio;
my $record = $biblio->record;
my $biblio = $order->biblio;
my $record = $biblio->record;
my $record_field = $record->field('008');
is(exists($record_field->{_data}), 1, 'Field has been added');
is( exists( $record_field->{_data} ), 1, 'Field has been added' );
# Test without calling the 008 handler
$account = $builder->build(
@ -288,4 +288,4 @@ subtest '_handle_008_field' => sub {
is( $record_field->{_data}, undef, 'Field has not been added' );
$schema->storage->txn_rollback;
}
}