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!
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 14b485c6db)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
81a74cb7a6
commit
684cad615c
|
|
@ -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 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue