Bug 42245: Prevent preselecting sort values for guarantor search

av-build-dropbox.inc takes a 'default' param

When building the patron we are setting this to the value of sort1, then sort2
This seems to remain cached, and when we build the guarantor search the sort2 value is used as the default
This patch ensures we pass a blank default to the modal

To recreate:
1 - Define 2 values for 'BSort1' in Administration -> Authorised values
2 - Define 2 values for 'BSort2' in Administration -> Authorised values
3 - Find a borrower who is eligible to have a guarantor
4 - Edit patron and assign values to sort 1 and 2 for this borrower and save
5 - Edit patron again and click 'Add guarantor'
6 - Note that sort 2 is populated
7 - Apply patch
8 - Reload borrower
9 - Confirm sort1 and 2 are empty

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2026-04-01 18:56:02 +00:00 committed by Lucas Gass
parent fda196565d
commit 183d1cf211
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 2 additions and 2 deletions

View File

@ -78,12 +78,12 @@
[% CASE 'sort1' %]
<li>
<label>Sort 1:</label>
[% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort1_filter", category="Bsort1", empty=1, size = 20 %]
[% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort1_filter", default="", category="Bsort1", empty=1, size = 20 %]
</li>
[% CASE 'sort2' %]
<li>
<label>Sort 2:</label>
[% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort2_filter", category="Bsort2", empty=1, size = 20 %]
[% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort2_filter", default="", category="Bsort2", empty=1, size = 20 %]
</li>
[% CASE 'search_field' %]
<li> [% INCLUDE patron_fields_dropdown %] </li>