Bugzilla – Attachment 126303 Details for
Bug 29010
Weight input pattern wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29010: fix pattern in search_field.weight
Bug-29010-fix-pattern-in-searchfieldweight.patch (text/plain), 2.64 KB, created by
Owen Leonard
on 2021-10-14 19:22:23 UTC
(
hide
)
Description:
Bug 29010: fix pattern in search_field.weight
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-10-14 19:22:23 UTC
Size:
2.64 KB
patch
obsolete
>From 9d284ac9950f42354b9342e3481c130fb741065c Mon Sep 17 00:00:00 2001 >From: Thomas Klausner <domm@plix.at> >Date: Tue, 14 Sep 2021 11:13:11 +0200 >Subject: [PATCH] Bug 29010: fix pattern in search_field.weight >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >search_field.weight is of type NUMERIC(5,2) in the database, and values >are rendered as floats in /admin/searchengine/elasticsearch/mappings.pl > >But the field validation only accepts INTs. This patch fixes the pattern >to accept NUMERIC(ish) values > >- Enable Elasticsearch (but no need to actually index anyting) >- go to cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl >- Enter an integer (eg "8") into any "weight" column and click save >- Koha now displays the value as NUMERIC, eg. "8.00" >- Change nothing, and click save again >- Save does not work, you get a warning by the browser that the input > does not match the requested format (because in the html field only > ints are allowed, but the DB stored the value as numeric and returns > it as such) >- Workaround: Change all the values back to ints (i.e. remove ".00"), > but this is very cumbersome if you have several weights > >- Apply the patch >- Now try to save again (without changing eg "8.00" to "8". It works >- Add a new weight (eg "4"), save, it's turned into "4.00", but saving > again still works > >Sponsored-by: Steiermärkische Landesbibliothek > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/modules/admin/searchengine/elasticsearch/mappings.tt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >index 2096a3305f..268bee4ed9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt >@@ -214,7 +214,7 @@ a.add, a.delete { > </td> > <td data-order="[% search_field.weight | html %]"> > [% IF search_field.mapped_biblios %] >- <input type="text" inputmode="numeric" pattern="[0-9]*" name="search_field_weight" value="[% search_field.weight | html %]" /> >+ <input type="text" inputmode="numeric" pattern="[0-9\.]*" name="search_field_weight" value="[% search_field.weight | html %]" /> > [% ELSE %] > <input type="text" name="search_field_weight" value=""> > [% END %] >-- >2.20.1
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 29010
:
124855
|
126303
|
127881
|
127882