@@ -, +, @@ options --- Koha/MarcModificationTemplate.pm | 2 +- admin/preferences.pl | 2 +- .../en/modules/admin/preferences/cataloguing.pref | 2 +- .../EditBiblioMarcModificationTemplatePreference.t | 14 +++++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) --- a/Koha/MarcModificationTemplate.pm +++ a/Koha/MarcModificationTemplate.pm @@ -25,7 +25,7 @@ use base qw(Koha::Object); =head1 NAME -Koha::MarcModificationTemplate - Koha Marc Modification Templat Object class +Koha::MarcModificationTemplate - Koha Marc Modification Template Object class =head1 API --- a/admin/preferences.pl +++ a/admin/preferences.pl @@ -115,7 +115,7 @@ sub _get_chunk { $add_blank = 1; } } elsif ( $options{choices} eq 'marcModTemplates' ) { - $options{choices} = { map { $_->template_id => $_->name } Koha::MarcModificationTemplates->search }; + $options{choices} = { map { $_->template_id => $_->name} Koha::MarcModificationTemplates->search->as_list }; $add_blank = 1; } else { die 'Unrecognized source of preference values: ' . $options{'choices'}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -220,7 +220,7 @@ Cataloging: - - Apply the MARC modification template with name - pref: SaveBiblioMarcModificationTemplate - class: modification-templates + choices: marcModTemplates - on records saved using the staff client simple MARC editor, advanced editor or HTTP API. Display: - --- a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t +++ a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t @@ -24,7 +24,8 @@ use MARC::Record; use XML::Simple; use C4::MarcModificationTemplates; use Koha::MarcModificationTemplates; -use C4::Biblio qw(AddBiblio ModBiblioMarc GetMarcBiblio); +use C4::Biblio qw(AddBiblio ModBiblioMarc DelBiblio); +use Koha::Biblios; eval{ use C4::Context; @@ -45,7 +46,7 @@ if (not defined $intranet) { } subtest 'Templates applied using simple and advanced MARC Editor' => sub { - plan tests => 13; + plan tests => 14; # Create "Test" MARC modification template #my $template_id = AddModificationTemplate('TEST'); @@ -85,7 +86,7 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { ); my ($biblionumber) = AddBiblio($record, ''); - my $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); + my $saved_record = Koha::Biblios->find($biblionumber)->metadata->record(); my $saved_record_250_field = $saved_record->field('250'); isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved'); is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio'); @@ -100,10 +101,13 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { $agent->field('password', $password); $agent->field('userid', $user); $agent->field('branch', ''); - $agent->click_ok('', 'Login to staff client'); + $agent->click_ok('', 'Login to staff interface'); + + $agent->content_lacks('Invalid username or password', 'Logged in to staff interface'); $agent->get_ok("$intranet/cgi-bin/koha/mainpage.pl", 'Load main page'); #FIXME: Remove? $agent->get_ok("$intranet/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber", 'Load bibliographic record in simple MARC editor'); + $agent->submit_form_ok( { form_id => 'f', @@ -112,7 +116,7 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { 'Save bibliographic record using simple MARC editor' ); - $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 }); + $saved_record = Koha::Biblios->find($biblionumber)->metadata->record(); $saved_record_250_field = $saved_record->field('250'); is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template'); --