Bugzilla – Attachment 177509 Details for
Bug 31856
Improve performance of serials subscriptions search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31856: Fix additional fields key value and use field id instead of name
Bug-31856-Fix-additional-fields-key-value-and-use-.patch (text/plain), 1.98 KB, created by
David Gustafsson
on 2025-02-04 16:28:35 UTC
(
hide
)
Description:
Bug 31856: Fix additional fields key value and use field id instead of name
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2025-02-04 16:28:35 UTC
Size:
1.98 KB
patch
obsolete
>From 0c591ae9e90cc8053bc7cb2d5d80ba9f8fc0ba62 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Tue, 4 Feb 2025 16:29:10 +0100 >Subject: [PATCH] Bug 31856: Fix additional fields key value and use field id > instead of name > >--- > C4/Serials.pm | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 1816f00151f..610e3846bef 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -638,23 +638,22 @@ sub SearchSubscriptions { > if ( $params->{results_limit} && $total_results > $params->{results_limit} ) { > $results = [ splice( @{$results}, 0, $params->{results_limit} ) ]; > } >- my %additional_fields_by_id = map { $_->id => $_->name } Koha::AdditionalFields->search( { tablename => 'subscription' } )->as_list; >- if (%additional_fields_by_id) { >+ my @additional_field_ids = map { $_->id } Koha::AdditionalFields->search( { tablename => 'subscription' } )->as_list; >+ if (@additional_field_ids) { > my %subscriptions_by_id = map { $_->{subscriptionid } => $_ } @{$results}; > my $field_values_rs = Koha::AdditionalFieldValues->search( > { >- field_id => { -in => [ keys %additional_fields_by_id ] }, >+ field_id => { -in => \@additional_field_ids }, > record_id => { -in => [ keys %subscriptions_by_id ] } > } > ); > while (my $field_value = $field_values_rs->next) { >- my $field_name = $additional_fields_by_id{$field_value->field_id}; >- $subscriptions_by_id{$field_value->record_id}->{additional_fields}->{$field_name} = $field_value->value; >+ $subscriptions_by_id{$field_value->record_id}->{additional_field_values}->{$field_value->field_id} = $field_value->value; > } > } > else { > for my $subscription ( @{$results} ) { >- $subscription->{additional_fields} = {}; >+ $subscription->{additional_field_values} = {}; > } > } > >-- >2.48.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 31856
:
142058
|
142156
|
142157
|
150651
|
150652
|
150653
|
151077
|
151078
|
177383
|
177384
|
177385
|
177386
|
177387
|
177482
|
177483
|
177484
|
177485
|
177486
|
177487
| 177509 |
177510
|
177511
|
177512
|
177514