Bugzilla – Attachment 185391 Details for
Bug 40651
Item search custom field selection is not populated in shareable link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40651: Select custom search field if passed in via link
Bug-40651-Select-custom-search-field-if-passed-in-.patch (text/plain), 2.58 KB, created by
Nick Clemens (kidclamp)
on 2025-08-14 13:05:57 UTC
(
hide
)
Description:
Bug 40651: Select custom search field if passed in via link
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-08-14 13:05:57 UTC
Size:
2.58 KB
patch
obsolete
>From c9178b728893fe3b735657971f3fdb1e773abd77 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 14 Aug 2025 12:59:18 +0000 >Subject: [PATCH] Bug 40651: Select custom search field if passed in via link > >This patch checks for a custom field value and preselects it in the dropdown if present > >To test: >1 - Browse to Administration - Item search fields >2 - Add a new search field pointing to a marc field with some known value on a record with items >3 - Browse to Item search >4 - Construct a search using your new field and search >5 - From results click 'Copy shareable link' >6 - Go to the link >7 - No results or wrong results! >8 - Edit the search >9 - Note your custom field is not selected >10 - Apply patch >11 - Visit the link again >12 - Correct results! >13 - Edit search >14 - Custom field is correctly selected! >--- > .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index a050fdf52e7..e586173426e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -134,9 +134,13 @@ > [% FOREACH field IN items_search_fields %] > [% marcfield = field.tagfield %] > [% IF field.tagsubfield.defined AND field.tagsubfield != "" %] >- [% marcfield = marcfield _ '$' _ field.tagsubfield %] >+ [% marcfield = "marc:" _ marcfield _ '$' _ field.tagsubfield %] >+ [% END %] >+ [% IF query.param('f').$i == marcfield || query.param('f') == marcfield %] >+ <option value="[% marcfield | html %]" data-authorised-values-category="[% field.authorised_values_category | html %]" selected="selected">[% field.label | html %] ([% marcfield | html %])</option> >+ [% ELSE %] >+ <option value="[% marcfield | html %]" data-authorised-values-category="[% field.authorised_values_category | html %]">[% field.label | html %] ([% marcfield | html %])</option> > [% END %] >- <option value="marc:[% marcfield | html %]" data-authorised-values-category="[% field.authorised_values_category | html %]">[% field.label | html %] ([% marcfield | html %])</option> > [% END %] > </optgroup> > [% END %] >-- >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 40651
:
185391
|
185392
|
185400
|
185401
|
185591
|
185592