Bugzilla – Attachment 169216 Details for
Bug 36515
Amend MARC modification templates so control fields can be copied to subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36515: (QA follow-up) Tidy code
Bug-36515-QA-follow-up-Tidy-code.patch (text/plain), 2.42 KB, created by
Kyle M Hall
on 2024-07-19 13:00:16 UTC
(
hide
)
Description:
Bug 36515: (QA follow-up) Tidy code
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2024-07-19 13:00:16 UTC
Size:
2.42 KB
patch
obsolete
>From ff87ba0e315f432b34aa5412c3d9044c23ff52d5 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 19 Jul 2024 08:57:54 -0400 >Subject: [PATCH] Bug 36515: (QA follow-up) Tidy code > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/SimpleMARC.pm | 13 +++++++------ > t/SimpleMARC.t | 9 ++------- > 2 files changed, 9 insertions(+), 13 deletions(-) > >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index 6b15b8d939a..425fbcd75b6 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -135,12 +135,12 @@ sub copy_and_replace_field { > > if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } > >- if ( >- ( !defined $fromSubfieldName or $fromSubfieldName eq '' ) >- and ( !defined $toSubfieldName or $toSubfieldName eq '' ) >- ) { >+ if ( ( !defined $fromSubfieldName or $fromSubfieldName eq '' ) >+ and ( !defined $toSubfieldName or $toSubfieldName eq '' ) ) >+ { > _copy_move_field( >- { record => $record, >+ { >+ record => $record, > from_field => $fromFieldName, > to_field => $toFieldName, > regex => $regex, >@@ -150,7 +150,8 @@ sub copy_and_replace_field { > ); > } else { > _copy_move_subfield( >- { record => $record, >+ { >+ record => $record, > from_field => $fromFieldName, > from_subfield => $fromSubfieldName, > to_field => $toFieldName, >diff --git a/t/SimpleMARC.t b/t/SimpleMARC.t >index da6b98ff7f0..597ec8c4126 100755 >--- a/t/SimpleMARC.t >+++ b/t/SimpleMARC.t >@@ -1526,14 +1526,9 @@ subtest 'copy_and_replace_field' => sub { > ); > > # Copy control field to subfield >- copy_and_replace_field( >- { record => $record, from_field => '001', to_field => '099', to_subfield => 'a' } ); >+ copy_and_replace_field( { record => $record, from_field => '001', to_field => '099', to_subfield => 'a' } ); > is_deeply( >- [ >- read_field( >- { record => $record, field => '099', subfield => 'a' } >- ) >- ], >+ [ read_field( { record => $record, field => '099', subfield => 'a' } ) ], > ['4815162342'], > 'Copy and replace - Update a subfield with content of control field' > ); >-- >2.30.2
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 36515
:
164575
|
165924
|
165928
|
165929
|
166026
|
166027
|
169215
| 169216