Bugzilla – Attachment 99026 Details for
Bug 6473
Test bug for Git-bz ✔ ❤ ★
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17510: enable use of subfield 0 in MMT actions
Bug-17510-enable-use-of-subfield-0-in-MMT-actions.patch (text/plain), 5.16 KB, created by
Andreas Roussos
on 2020-02-14 20:18:15 UTC
(
hide
)
Description:
Bug 17510: enable use of subfield 0 in MMT actions
Filename:
MIME Type:
Creator:
Andreas Roussos
Created:
2020-02-14 20:18:15 UTC
Size:
5.16 KB
patch
obsolete
>From 55d12df896416beee34ac1b4011b1721276487aa Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <arouss1980@gmail.com> >Date: Fri, 14 Feb 2020 19:50:39 +0000 >Subject: [PATCH] Bug 17510: enable use of subfield 0 in MMT actions > >When adding MARC modification template (MMT) actions, if a subfield >value of 0 (zero) is entered it will not show up in the action's >description upon saving. Also, if you try to modify an authority or >biblio record using actions that refer to subfield 0 the procedure >will fail. > >This patch fixes that. > >Test plan: >0) Create a MARC modification template and add some actions to it, > ideally testing all action types (Delete/Add new/Update existing > or add new/Move/Copy/Copy and replace); make sure you input a 0 > (integer zero) in the text box for the subfield value(s). >1) As you save each action, observe that subfield 0 ($0) is missing > from the action description. >2) Home > Tools > Batch record modification: try to modify a biblio- > graphic record using the modification template you just created. > Observe that you get an error in the system logs if you click on > 'Show MARC' or 'Modify selected records'. >3) Apply the patch. >4) Repeat steps 0-2. The subfield value ($0) should be displayed in > the action description and the Batch record modification should > work without problems. > >https://bugs.koha-community.org/show_bug.cgi?id=6473 >--- > Koha/SimpleMARC.pm | 4 ++-- > .../prog/en/modules/tools/marc_modification_templates.tt | 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index 5a916bdb03..cb92bff91a 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -164,7 +164,7 @@ sub update_field { > > if ( ! ( $record && $fieldName ) ) { return; } > >- if ( not $subfieldName or $subfieldName eq '' ) { >+ if ( not defined $subfieldName or $subfieldName eq '' ) { > # FIXME I'm not sure the actual implementation is correct. > die "This action is not implemented yet"; > #_update_field({ record => $record, field => $fieldName, values => \@values }); >@@ -296,7 +296,7 @@ sub read_field { > my $subfieldName = $params->{subfield}; > my $field_numbers = $params->{field_numbers} // []; > >- if ( not $subfieldName or $subfieldName eq '' ) { >+ if ( not defined $subfieldName or $subfieldName eq '' ) { > _read_field({ record => $record, field => $fieldName, field_numbers => $field_numbers }); > } else { > _read_subfield({ record => $record, field => $fieldName, subfield => $subfieldName, field_numbers => $field_numbers }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >index 37477c73b6..9098bda200 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >@@ -133,14 +133,14 @@ > > field > >- [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield | html %][% END %] >+ [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield.length ) %]$[% ActionsLoo.from_subfield | html %][% END %] > > [% IF ( ActionsLoo.field_value ) %] > with value <i>[% ActionsLoo.field_value | html %]</i> > [% END %] > > [% IF ( ActionsLoo.to_field ) %] >- to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield ) %]$[% ActionsLoo.to_subfield | html %][% END %] >+ to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield.length ) %]$[% ActionsLoo.to_subfield | html %][% END %] > > [% IF ( ActionsLoo.to_regex_search ) %] > using RegEx s<strong>/[% ActionsLoo.to_regex_search | html %]/[% ActionsLoo.to_regex_replace | html %]/[% ActionsLoo.to_regex_modifiers | html %]</strong> >@@ -151,7 +151,7 @@ > [% IF ( ActionsLoo.conditional_if ) %] if [% END %] > [% IF ( ActionsLoo.conditional_unless ) %] unless [% END %] > >- [% ActionsLoo.conditional_field | html %][% IF ( ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield | html %][% END %] >+ [% ActionsLoo.conditional_field | html %][% IF ( ActionsLoo.conditional_subfield.length ) %]$[% ActionsLoo.conditional_subfield | html %][% END %] > > [% IF ( ActionsLoo.conditional_comparison_exists ) %] exists [% END %] > [% IF ( ActionsLoo.conditional_comparison_not_exists ) %] does not exist [% END %] >-- >2.11.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 6473
:
4386
|
6837
|
6838
|
6839
|
6840
|
6841
|
6842
|
6843
|
7154
|
7155
|
7567
|
7994
|
7995
|
7996
|
7997
|
8018
|
9807
|
9808
|
9813
|
9831
|
9832
|
9836
|
9854
|
10842
|
10843
|
10844
|
10845
|
10846
|
10847
|
10848
|
10849
|
10850
|
10851
|
10852
|
10853
|
10854
|
10855
|
10856
|
10857
|
10858
|
11540
|
11543
|
11544
|
12502
|
12513
|
12514
|
12515
|
12516
|
12517
|
12518
|
12519
|
13473
|
13673
|
14955
|
14969
|
14970
|
14972
|
15201
|
18949
|
18950
|
18951
|
18952
|
18953
|
18954
|
18955
|
18956
|
18957
|
18958
|
18959
|
18960
|
18961
|
18962
|
18963
|
18971
|
18972
|
19518
|
19519
|
19591
|
19592
|
19871
|
19879
|
19880
|
19881
|
19882
|
20011
|
20012
|
20013
|
20014
|
22477
|
22481
|
22482
|
22496
|
22502
|
22503
|
31958
|
32444
|
32445
|
32446
|
32447
|
32448
|
32449
|
32450
|
32451
|
32452
|
34200
|
34201
|
34625
|
34999
|
35130
|
35269
|
35273
|
35274
|
35275
|
35276
|
35277
|
35279
|
35280
|
35303
|
40954
|
40957
|
45345
|
45349
|
45731
|
45732
|
45733
|
45734
|
47283
|
47284
|
47298
|
47299
|
47300
|
47334
|
47336
|
49083
|
56974
|
61059
|
61069
|
62038
|
65313
|
77301
|
78016
|
79959
|
80178
|
80179
|
80180
|
80181
|
80182
|
84400
|
86644
|
86645
|
87152
|
88128
|
95586
|
95716
|
97394
|
99026
|
99027
|
114217
|
114218
|
114219
|
114220
|
114221
|
114222
|
114223
|
114224
|
114225
|
114226
|
119255
|
121181
|
131891
|
131893
|
131894
|
134862
|
144109
|
144144
|
144671
|
144672
|
144673
|
147183
|
149030
|
149031
|
149032
|
149033
|
160566
|
160567
|
160568