Bugzilla – Attachment 183317 Details for
Bug 40118
Regression - 'Holds to pull' library filters don't work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40118: Only concat ^ and $ if table is ajax
Bug-40118-Only-concat--and--if-table-is-ajax.patch (text/plain), 2.59 KB, created by
Paul Derscheid
on 2025-06-18 07:43:06 UTC
(
hide
)
Description:
Bug 40118: Only concat ^ and $ if table is ajax
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2025-06-18 07:43:06 UTC
Size:
2.59 KB
patch
obsolete
>From af63efdc37ac749b87f36125cd42c80f16d3cc7a Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 11 Jun 2025 13:22:17 +0000 >Subject: [PATCH] Bug 40118: Only concat ^ and $ if table is ajax > >Test plan, k-t-d, before applying patches: >1) Place a hold (next available) to biblio 76 and 437: > http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 > http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437 >2) Visit the 'holds to pull' page: > http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl >3) Notice the 'Libraries' filter contains 'Centervile' twice. Notice the > filtering never works regardless of option picked. >4) Apply patches. Repeat test plan. Notice 'Centerville' only shows > once. Notice filtering works. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index dcfef3cf7a4..58dc8567ea1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1058,12 +1058,14 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > filters_options[i] = filters_options[i](table_dt); > } > $(filters_options[i]).each(function () { >+ let optionValue = >+ table_dt.settings()[0].ajax !== null >+ ? `^${this._id}$` >+ : this._id; > let o = $( >- '<option value="^%s$">%s</option>'.format( >- this._id, >- this._str >- ) >+ `<option value="${optionValue}">${this._str}</option>` > ); >+ > // Compare with lc, or selfreg won't match ^SELFREG$ for instance, see bug 32517 > // This is only for category, we might want to apply it only in this case. > existing_search = existing_search.toLowerCase(); >@@ -1142,7 +1144,6 @@ function _dt_add_delay_filters(table_dt, table_node) { > .find("select") > .unbind() > .bind("keyup change", function () { >- let value = this.value.length ? "^" + this.value + "$" : ""; > col_select_search(i, this.value); > }); > }); >-- >2.50.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 40118
:
183161
|
183162
|
183164
|
183169
|
183170
|
183280
|
183281
|
183282
|
183316
| 183317 |
183318