Bugzilla – Attachment 153980 Details for
Bug 34223
ILL status filter does not load immediately after selecting a backend filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34223: (follow-up) Restore status_alias handling
Bug-34223-follow-up-Restore-statusalias-handling.patch (text/plain), 3.33 KB, created by
Laura Escamilla
on 2023-07-27 13:57:26 UTC
(
hide
)
Description:
Bug 34223: (follow-up) Restore status_alias handling
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2023-07-27 13:57:26 UTC
Size:
3.33 KB
patch
obsolete
>From 244a4d63cbc550227785aadd07ae75fc3dbf1598 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 27 Jul 2023 12:25:20 +0100 >Subject: [PATCH] Bug 34223: (follow-up) Restore status_alias handling > >By reducing the original call to all distinct 'status' we also removed >the status_alias combinations. This patch adds an additional distinct >query to fetch all 'status_alias' and add them to the returned data >structure. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> >--- > Koha/Illbackend.pm | 41 +++++++++++++++++++++++++++++++---------- > 1 file changed, 31 insertions(+), 10 deletions(-) > >diff --git a/Koha/Illbackend.pm b/Koha/Illbackend.pm >index cb27e21154..df29e970a5 100644 >--- a/Koha/Illbackend.pm >+++ b/Koha/Illbackend.pm >@@ -48,6 +48,8 @@ Return a list of existing ILL statuses > sub existing_statuses { > my ( $self, $backend_id ) = @_; > >+ my @data; >+ > # NOTE: This query fetches all distinct status's found in the database for this backend. > # We need the 'status' field for obvious reasons, the 'backend' field is required to not > # throw 'Koha::Exceptions::Ill::InvalidBackendId' when we're converting to a Koha object. >@@ -61,19 +63,38 @@ sub existing_statuses { > group_by => [qw/status backend/], > } > ); >+ while ( my $request = $ill_requests->next ) { >+ my $status_data = $request->strings_map; > >- my @data; >- while (my $request = $ill_requests->next) { >+ if ( $status_data->{status} ) { >+ push @data, { >+ $status_data->{status}->{str} ? ( str => $status_data->{status}->{str} ) >+ : $status_data->{status}->{code} ? ( str => $status_data->{status}->{code} ) >+ : (), >+ $status_data->{status}->{code} ? ( code => $status_data->{status}->{code} ) : (), >+ }; >+ } >+ } >+ >+ # Now do the same to get all status_aliases >+ $ill_requests = Koha::Illrequests->search( >+ { backend => $backend_id }, >+ { >+ select => [ 'status_alias', \'MAX(illrequest_id)', 'backend' ], >+ as => [qw/ status_alias illrequest_id backend /], >+ group_by => [qw/status_alias backend/], >+ } >+ ); >+ while ( my $request = $ill_requests->next ) { > my $status_data = $request->strings_map; > >- foreach my $status_class ( qw(status_alias status) ){ >- if ($status_data->{$status_class}){ >- push @data, { >- $status_data->{$status_class}->{str} ? (str => $status_data->{$status_class}->{str}) : >- $status_data->{$status_class}->{code} ? (str => $status_data->{$status_class}->{code}) : (), >- $status_data->{$status_class}->{code} ? (code => $status_data->{$status_class}->{code}) : (), >- } >- } >+ if ( $status_data->{status_alias} ) { >+ push @data, { >+ $status_data->{status_alias}->{str} ? ( str => $status_data->{status_alias}->{str} ) >+ : $status_data->{status_alias}->{code} ? ( str => $status_data->{status_alias}->{code} ) >+ : (), >+ $status_data->{status_alias}->{code} ? ( code => $status_data->{status_alias}->{code} ) : (), >+ }; > } > } > >-- >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 34223
:
153289
|
153953
|
153956
|
153957
|
153961
|
153962
|
153963
|
153968
|
153973
|
153978
|
153979
|
153980
|
153981
|
153989
|
153990
|
154026
|
154027
|
154028
|
154029
|
154030
|
154031
|
154032
|
154033
|
154068
|
154069
|
154070
|
154071
|
155280
|
155493