From 7d2f41adee745f73eda58656de7789d2d7ca52f2 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 7 Jan 2025 14:47:02 +0000 Subject: [PATCH] Revert "Bug 36025: Incorrect clause in patron search" This reverts commit 79085c47234d8e5bab0a883183c85a2585158774. Signed-off-by: Katrin Fischer --- Koha/Template/Plugin/ExtendedAttributeTypes.pm | 5 +---- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 2 +- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Koha/Template/Plugin/ExtendedAttributeTypes.pm b/Koha/Template/Plugin/ExtendedAttributeTypes.pm index d867270f07..9511b7325e 100644 --- a/Koha/Template/Plugin/ExtendedAttributeTypes.pm +++ b/Koha/Template/Plugin/ExtendedAttributeTypes.pm @@ -33,10 +33,7 @@ sub all { sub codes { my ( $self, $params ) = @_; - - my @codes = Koha::Patron::Attribute::Types->search($params)->get_column('code'); - - return \@codes; + return Koha::Patron::Attribute::Types->search($params)->get_column('code'); } 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index fe1da4e2c4..e831779839 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -280,7 +280,7 @@ }, {}); [% IF Koha.Preference('ExtendedPatronAttributes') %] - [% SET extended_attribute_types = ExtendedAttributeTypes.codes( staff_searchable => 1, searched_by_default => 1 ) %] + [% SET extended_attribute_types = [ ExtendedAttributeTypes.codes( staff_searchable => 1, searched_by_default => 1 ) ] %] var extended_attribute_types = [% To.json(extended_attribute_types || []) | $raw %]; [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 1e050dc4d8..e76bf876f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -860,7 +860,7 @@ function buildPatronSearchQuery(term, options) { if ( typeof options !== "undefined" && ((options.search_fields == "standard" && - options.extended_attribute_types.length > 0) || + options.extended_attribute_types) || searched_attribute_fields.length > 0) && extendedPatronAttributes ) {