From 3aacb9f0ece8129856caac35b062407d1ab138fa Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 12 Feb 2021 21:35:20 +0000 Subject: [PATCH] Bug 26436: fix city/town pulldown in all cases This patch uses a different selector to target the inputs and accounts for the fact that altcontactcity is actually called altcontactaddress3 1. add some cities to /cgi-bin/koha/admin/cities.pl with city, state, zipcode, and country defined 2. On PatronQuickAddFields select all, this way we can test all the alternate city selects 3. Go to quick add patron, and select a city from the dropdown, the city/state/zip/country doesn't populate (Alternate address city doesnt work either) 4. Apply patch 5. Do 1 - 3 again, it should work 6. Try the regular patron form, make sure all city/town dropdowns still work --- koha-tmpl/intranet-tmpl/prog/js/members.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js index d128e4f678..5ea4f9e710 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members.js @@ -209,10 +209,10 @@ $(document).ready(function(){ var addressfield = $(this).data("addressfield"); var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/); var matches = selected_city.match( myRegEx ); - $('input[name="' + addressfield + "zipcode").val( matches[1] ); - $('input[name="' + addressfield + "city").val( matches[2] ); - $('input[name="' + addressfield + "state").val( matches[3] ); - $('input[name="' + addressfield + "country").val( matches[4] ); + $('input[name="' + addressfield + "zipcode\"]").val( matches[1] ); + $('input[name="' + addressfield + "city\"], input[name=\"altcontactaddress3").val( matches[2] ); + $('input[name="' + addressfield + "state\"]").val( matches[3] ); + $('input[name="' + addressfield + "country\"]").val( matches[4] ); }); dateformat = $("#dateofbirth").siblings(".hint").first().html(); -- 2.11.0