Bugzilla – Attachment 63415 Details for
Bug 18579
Problem with :Filter::MARC::EmbedItemsAvailability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18579: Fix call to append_fields, fix tests
Bug-18579-Fix-call-to-appendfields-fix-tests.patch (text/plain), 2.13 KB, created by
Marcel de Rooy
on 2017-05-12 08:00:58 UTC
(
hide
)
Description:
Bug 18579: Fix call to append_fields, fix tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-05-12 08:00:58 UTC
Size:
2.13 KB
patch
obsolete
>From 58ee69bfdfda0aa83fb27eda623d951deb5cd495 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 12 May 2017 09:25:23 +0200 >Subject: [PATCH] Bug 18579: Fix call to append_fields, fix tests >Content-Type: text/plain; charset=utf-8 > >MARC::Record::append_fields takes a list of MARC::Field (not an arrayref) > >Use $record->subfield() instead of $record->field()->subfield() to avoid errors >when field doesn't exist > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Filter/MARC/EmbedItemsAvailability.pm | 2 +- > t/db_dependent/Koha/Filter/EmbedItemsAvailability.t | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/Filter/MARC/EmbedItemsAvailability.pm b/Koha/Filter/MARC/EmbedItemsAvailability.pm >index e42ba02..fed3aa2 100644 >--- a/Koha/Filter/MARC/EmbedItemsAvailability.pm >+++ b/Koha/Filter/MARC/EmbedItemsAvailability.pm >@@ -90,7 +90,7 @@ sub _processrecord { > else { > # no field, create one > $destination_field = MARC::Field->new( '999', '', '', x => $not_onloan_items ); >- $record->append_fields([$destination_field]); >+ $record->append_fields($destination_field); > } > > return $record; >diff --git a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >index 74a8d03e..8f250dd 100755 >--- a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >+++ b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >@@ -142,10 +142,10 @@ subtest 'EmbedItemsAvailability tests' => sub { > is( ref($processor), 'Koha::RecordProcessor', 'Created record processor' ); > > $record = GetMarcBiblio($biblionumber); >- ok( !defined $record->field('999')->subfield('x'), q{The record doesn't originally contain 999$x} ); >+ ok( !defined $record->subfield('999', 'x'), q{The record doesn't originally contain 999$x} ); > # Apply filter > $processor->process($record); >- is($record->field('999')->subfield('x'), 1, 'There is only one item with undef onloan'); >+ is($record->subfield('999', 'x'), 1, 'There is only one item with undef onloan'); > > $schema->storage->txn_rollback(); > }; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18579
:
63389
|
63390
|
63394
|
63395
|
63396
|
63397
|
63414
| 63415