Bugzilla – Attachment 142156 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: Don't fetch additional field valudes if there are no fields
Bug-31856-Dont-fetch-additional-field-valudes-if-t.patch (text/plain), 1.75 KB, created by
David Gustafsson
on 2022-10-19 13:59:49 UTC
(
hide
)
Description:
Bug 31856: Don't fetch additional field valudes if there are no fields
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2022-10-19 13:59:49 UTC
Size:
1.75 KB
patch
obsolete
>From 5da2eb12c5d060ac2efa71ea0d6e84eae01616ea Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Wed, 19 Oct 2022 15:59:22 +0200 >Subject: [PATCH] Bug 31856: Don't fetch additional field valudes if there are > no fields > >--- > C4/Serials.pm | 24 +++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index a0509c5376..1df0bc87e7 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -623,16 +623,22 @@ sub SearchSubscriptions { > for my $subscription ( @$results ) { > $subscription->{cannotedit} = not can_edit_subscription( $subscription ); > $subscription->{cannotdisplay} = not can_show_subscription( $subscription ); >- my @additional_field_values = Koha::AdditionalFieldValues->search( >- { >- field_id => { -in => [ keys %additional_fields_by_id ] }, >- record_id => $subscription->{subscriptionid} >- } >- )->as_list; > >- $subscription->{additional_fields} = { >- map { $additional_fields_by_id{$_->field_id} => $_->value } @additional_field_values >- }; >+ if (%additional_fields_by_id) { >+ my @additional_field_values = Koha::AdditionalFieldValues->search( >+ { >+ field_id => { -in => [ keys %additional_fields_by_id ] }, >+ record_id => $subscription->{subscriptionid} >+ } >+ )->as_list; >+ >+ $subscription->{additional_fields} = { >+ map { $additional_fields_by_id{$_->field_id} => $_->value } @additional_field_values >+ }; >+ } >+ else { >+ $subscription->{additional_fields} = {}; >+ } > } > > return @$results; >-- >2.35.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