Bugzilla – Attachment 136776 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.91 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-06-30 13:58:35 UTC
(
hide
)
Description:
Bug 30848: Fix issue exposed by unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-06-30 13:58:35 UTC
Size:
1.91 KB
patch
obsolete
>From 92852f381987e8ba91671e2c6439a5542e6f1549 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> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > 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.34.1
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