Bugzilla – Attachment 136261 Details for
Bug 30848
Introduce Koha::Filter::ExpandCodedFields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30848: Fix issue exposed by unit tests
Bug-30848-Fix-issue-exposed-by-unit-tests.patch (text/plain), 1.85 KB, created by
Nick Clemens (kidclamp)
on 2022-06-17 13:12:41 UTC
(
hide
)
Description:
Bug 30848: Fix issue exposed by unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-06-17 13:12:41 UTC
Size:
1.85 KB
patch
obsolete
>From 74115b1604e279232530695bc27ef09d383727bf Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 13 Jun 2022 14:26:33 +0100 >Subject: [PATCH] Bug 30848: Fix issue exposed by unit tests > >This patch changes the 'map' to a simple for loop so that we can easily >map multiple subfields to a field without overwriting the first previous >subfields in the structure. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Filter/MARC/ExpandCodedFields.pm | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > >diff --git a/Koha/Filter/MARC/ExpandCodedFields.pm b/Koha/Filter/MARC/ExpandCodedFields.pm >index 79b056431f..909d908e01 100644 >--- a/Koha/Filter/MARC/ExpandCodedFields.pm >+++ b/Koha/Filter/MARC/ExpandCodedFields.pm >@@ -114,14 +114,8 @@ sub _getCodedFields { > my $cached = $cache->get_from_cache( $cache_key, { unsafe => 1 } ); > return $cached if $cached; > >- my $coded_fields = { >- map { >- $_->tagfield => { >- $_->tagsubfield => { >- 'authorised_value' => $_->authorised_value >- } >- } >- } Koha::MarcSubfieldStructures->search( >+ my $coded_fields = {}; >+ my @fields = Koha::MarcSubfieldStructures->search( > { > frameworkcode => $frameworkcode, > authorised_value => { '>' => '' } >@@ -130,8 +124,10 @@ sub _getCodedFields { > columns => [ 'tagfield', 'tagsubfield', 'authorised_value' ], > order_by => [ 'tagfield', 'tagsubfield' ] > } >- )->as_list >- }; >+ )->as_list; >+ for my $field (@fields) { >+ $coded_fields->{ $field->tagfield }->{ $field->tagsubfield }->{'authorised_value'} = $field->authorised_value; >+ } > > $cache->set_in_cache( $cache_key, $coded_fields ); > return $coded_fields; >-- >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 30848
:
135338
|
135353
|
135363
|
135364
|
135386
|
135387
|
135388
|
135418
|
135421
|
135422
|
135423
|
135424
|
135425
|
135707
|
135708
|
135709
|
135710
|
135711
|
135712
|
135713
|
135714
|
135715
|
135716
|
135717
|
135770
|
136025
|
136026
|
136027
|
136259
|
136260
|
136261
|
136262
|
136774
|
136775
|
136776
|
136777