Bugzilla – Attachment 164691 Details for
Bug 36152
Allow to add jQuery directly in custom pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36152: Tidy
Bug-36152-Tidy.patch (text/plain), 4.45 KB, created by
Nick Clemens (kidclamp)
on 2024-04-11 13:25:03 UTC
(
hide
)
Description:
Bug 36152: Tidy
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-04-11 13:25:03 UTC
Size:
4.45 KB
patch
obsolete
>From 030e30459174b15f88f791c980019ea24306d35a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 11 Apr 2024 13:24:48 +0000 >Subject: [PATCH] Bug 36152: Tidy > >--- > Koha/SearchEngine/Elasticsearch.pm | 18 +++++++-------- > .../Elasticsearch/QueryBuilder.pm | 23 ++++++++----------- > 2 files changed, 19 insertions(+), 22 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch.pm b/Koha/SearchEngine/Elasticsearch.pm >index 54f3ea8f727..803fcfe5ddb 100644 >--- a/Koha/SearchEngine/Elasticsearch.pm >+++ b/Koha/SearchEngine/Elasticsearch.pm >@@ -202,21 +202,21 @@ sub get_elasticsearch_mappings { > # TODO be aware of date formats, but this requires pre-parsing > # as ES will simply reject anything with an invalid date. > my $es_type = 'text'; >- if ($type eq 'boolean') { >+ if ( $type eq 'boolean' ) { > $es_type = 'boolean'; >- } elsif ($type eq 'number' || $type eq 'sum') { >+ } elsif ( $type eq 'number' || $type eq 'sum' ) { > $es_type = 'integer'; >- } elsif ($type eq 'isbn' || $type eq 'stdno') { >+ } elsif ( $type eq 'isbn' || $type eq 'stdno' ) { > $es_type = 'stdno'; >- } elsif ($type eq 'year') { >+ } elsif ( $type eq 'year' ) { > $es_type = 'year'; >- } elsif ($type eq 'callnumber') { >+ } elsif ( $type eq 'callnumber' ) { > $es_type = 'cn_sort'; >- } elsif ($type eq 'geo_point') { >+ } elsif ( $type eq 'geo_point' ) { > $es_type = 'geo_point'; > } > >- if ($type eq 'geo_point') { >+ if ( $type eq 'geo_point' ) { > $name =~ s/_(lat|lon)$//; > } > >@@ -741,13 +741,13 @@ sub marc_records_to_documents { > } > } > >- foreach my $field (@{$rules->{geo_point}}) { >+ foreach my $field ( @{ $rules->{geo_point} } ) { > next unless $record_document->{$field}; > my $geofield = $field; > $geofield =~ s/_(lat|lon)$//; > my $axis = $1; > my $vals = $record_document->{$field}; >- for my $i (0 .. @$vals - 1) { >+ for my $i ( 0 .. @$vals - 1 ) { > my $val = $record_document->{$field}[$i]; > $record_document->{$geofield}[$i]{$axis} = $val; > } >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index 53541c4022c..e8f28a92007 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -936,10 +936,10 @@ sub _create_query_string { > $es_advanced_searches = []; > my @string_queries; > foreach my $q (@queries) { >- if ($q->{field} && $q->{field} eq 'geolocation') { >- push(@$es_advanced_searches, $q); >+ if ( $q->{field} && $q->{field} eq 'geolocation' ) { >+ push( @$es_advanced_searches, $q ); > } else { >- push(@string_queries, $q) >+ push( @string_queries, $q ); > } > } > >@@ -1428,27 +1428,24 @@ sub _rebuild_to_es_advanced_query { > > my %filter; > for my $advanced_query (@$es_advanced_searches) { >- if ( $advanced_query->{field} eq 'geolocation') { >- my ($lat, $lon, $distance) = map { $_ =~ /:(.*)\*/ } split('\s+', $advanced_query->{operand}); >+ if ( $advanced_query->{field} eq 'geolocation' ) { >+ my ( $lat, $lon, $distance ) = map { $_ =~ /:(.*)\*/ } split( '\s+', $advanced_query->{operand} ); > $filter{geo_distance} = { >- distance => $distance, >+ distance => $distance, > geolocation => { > lat => $lat, > lon => $lon, > } > }; >- } >- else { >- warn "unknown advanced ElasticSearch query: ".join(', ',%$advanced_query); >+ } else { >+ warn "unknown advanced ElasticSearch query: " . join( ', ', %$advanced_query ); > } > } > > $res->{query} = { > bool => { >- must => { >- query_string => $query_string >- }, >- filter => \%filter, >+ must => { query_string => $query_string }, >+ filter => \%filter, > } > }; > >-- >2.39.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 36152
: 164691