Bugzilla – Attachment 191884 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
1d6008b.patch (text/plain), 2.08 KB, created by
David Nind
on 2026-01-22 19:20:39 UTC
(
hide
)
Description:
Bug 41602: Allow _status to be in nested structure
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-22 19:20:39 UTC
Size:
2.08 KB
patch
obsolete
>From 1d6008b2928af7d0e9f47728763decd760d11a92 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. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Items.pm | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/Koha/Items.pm b/Koha/Items.pm >index 668d5f4bac..062ade8763 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.39.5 >
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