Bugzilla – Attachment 191863 Details for
Bug 41602
Cannot combine filters with holds status filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41602: Allow _status to be in nested structure
b27b1ef.patch (text/plain), 2.03 KB, created by
Jonathan Druart
on 2026-01-22 14:36:39 UTC
(
hide
)
Description:
Bug 41602: Allow _status to be in nested structure
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-22 14:36:39 UTC
Size:
2.03 KB
patch
obsolete
>From b27b1efcb10c95f0774cdec467bbc1a2c619e5fa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 22 Jan 2026 15:32:39 +0100 >Subject: [PATCH] Bug 41602: Allow _status to be in nested structure > >This patch allows _status to be in a nested structure. > >Cannot be combined in all the possible ways, but at least it should fix >the UI. > >Test plan: >Use the filters on the holdings table and confirm that you can combine >the status with other filters. >--- > Koha/Items.pm | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index 668d5f4bacc..062ade8763a 100644 >--- a/Koha/Items.pm >+++ b/Koha/Items.pm >@@ -659,9 +659,42 @@ Filters items based on the specified status. > > =cut > >+sub _extract_custom_attrs { >+ my ($params) = @_; >+ my %custom_attrs; >+ my $clean_params = _process_params( $params, \%custom_attrs ); >+ return ( \%custom_attrs, $clean_params ); >+} >+ >+sub _process_params { >+ my ( $params, $custom_attrs ) = @_; >+ >+ return $params unless ref $params; >+ >+ if ( ref $params eq 'HASH' ) { >+ my %clean; >+ for my $key ( keys %$params ) { >+ if ( $key =~ /^_(.+)/ ) { >+ $custom_attrs->{$key} = $params->{$key}; >+ } else { >+ $clean{$key} = _process_params( $params->{$key}, $custom_attrs ); >+ } >+ } >+ return \%clean; >+ } elsif ( ref $params eq 'ARRAY' ) { >+ return [ map { _process_params( $_, $custom_attrs ) } @$params ]; >+ } else { >+ return $params; >+ } >+} >+ > sub search { > my ( $self, $params, $attributes ) = @_; >- my $status = ( $params && ref($params) eq 'HASH' ) ? delete $params->{_status} : undef; >+ >+ my ( $custom_attrs, $clean_params ) = _extract_custom_attrs($params); >+ $params = $clean_params; >+ >+ my $status = $custom_attrs->{_status}; > if ($status) { > if ( $status eq 'checked_out' ) { > $self = $self->filter_by_checked_out( { onsite_checkout => 0 } ); >-- >2.43.0 >
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 41602
:
191862
|
191863
|
191883
|
191884
|
191916