Bugzilla – Attachment 157189 Details for
Bug 18138
Use MARC modification template when adding/updating bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18138: Fix tests, system preference specification and options
Bug-18138-Fix-tests-system-preference-specificatio.patch (text/plain), 5.11 KB, created by
David Gustafsson
on 2023-10-16 13:04:02 UTC
(
hide
)
Description:
Bug 18138: Fix tests, system preference specification and options
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2023-10-16 13:04:02 UTC
Size:
5.11 KB
patch
obsolete
>From d2a98952b5a3dd977c8f3f09106427f1840c29b5 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Mon, 16 Oct 2023 14:53:12 +0200 >Subject: [PATCH] Bug 18138: Fix tests, system preference specification and > 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(-) > >diff --git a/Koha/MarcModificationTemplate.pm b/Koha/MarcModificationTemplate.pm >index 049f2c2d857..c04d98eb853 100644 >--- a/Koha/MarcModificationTemplate.pm >+++ b/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 > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 4a34652f5b7..aa90ecf24bd 100755 >--- a/admin/preferences.pl >+++ b/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'}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index b73e509115d..ed2286c3b91 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/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: > - >diff --git a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >index 0d53ca6c980..0245bb42232 100755 >--- a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t >+++ b/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'); > >-- >2.42.0
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 18138
:
61442
|
61443
|
61734
|
82783
|
86617
|
110266
|
110269
|
110270
|
110272
|
118439
|
118440
|
118441
|
118442
|
118443
|
118444
|
118824
|
120709
|
123125
|
123127
|
123128
|
123129
|
123130
|
123131
|
123132
|
123133
|
123137
|
124466
|
124467
|
124468
|
124469
|
124470
|
124471
|
124472
|
124473
|
124474
|
124475
|
124476
|
124477
|
124478
|
124484
|
124485
|
124486
|
124492
|
124493
|
124991
|
125157
|
148004
|
148005
|
148006
|
148007
|
148008
|
148009
|
157183
|
157184
|
157185
|
157186
|
157187
|
157188
|
157189
|
157190
|
157485
|
157486
|
157487
|
157488
|
157489
|
157490
|
157491
|
158414
|
158415
|
158416
|
158417
|
158418
|
158419
|
158420
|
158421
|
162612
|
162613