Bug 26436

Summary: Quick add patron will not copy over details from cities and towns pull down into patron details
Product: Koha Reporter: Dale <drigney>
Component: PatronsAssignee: Lucas Gass (lukeg) <lucas>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: barbara.johnson, gmcharlt, jonathan.druart, julian.maurice, kyle.m.hall, lucas
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18569
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 3766    
Bug Blocks:    
Attachments: Bug 26436: fix city/town pulldown
Bug 26436: fix city/town pulldown
Bug 26436: fix city/town pulldown in all cases

Description Dale 2020-09-11 16:41:34 UTC
When using the quick add patron option in koha 19.11 : 

If a library has cities and towns pre-populated in a drop down list and has added this field into the quick add patron form this information will not copy into the full patron form after saving.

This was fixed in bug 18569 for 17.11 but is not working in 19.11.
Comment 1 Jonathan Druart 2020-12-02 14:39:55 UTC
Confirmed in master.
Certainly broken by
  commit 4605d76a73f9b13ba3b0259e3f480fb396051309
  Bug 3766: Cities/Towns only on one address
Comment 2 Lucas Gass (lukeg) 2021-01-21 04:20:32 UTC Comment hidden (obsolete)
Comment 3 PTFS Europe Sandboxes 2021-01-21 14:42:41 UTC Comment hidden (obsolete)
Comment 4 Julian Maurice 2021-02-12 09:47:34 UTC
It doesn't populate the City field for the alternate contact address. Probably because the input's name is "altcontactaddress3" and thus doesn't end with "city".
Can it be fixed ?
Other than that the patch works well.
Comment 5 Lucas Gass (lukeg) 2021-02-12 21:38:01 UTC
Created attachment 116852 [details] [review]
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
Comment 6 Lucas Gass (lukeg) 2021-02-12 21:43:59 UTC
(In reply to Julian Maurice from comment #4)
> It doesn't populate the City field for the alternate contact address.
> Probably because the input's name is "altcontactaddress3" and thus doesn't
> end with "city".
> Can it be fixed ?
> Other than that the patch works well.

Good catch. Is my new patch too much of a work around now? It's too bad that the alternate contact city field is borrowers.altcontactaddress3 in the database while state, zipcode, and country are altcontactstate, altcontactzipcode, and altcontactcountry.

But fixing that seems to be out of the scope of this bug.