Bug 15644 - City dropdown default selection when modifying a patron matches only on city
Summary: City dropdown default selection when modifying a patron matches only on city
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: Academy
: 18744 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-22 15:05 UTC by Nick Clemens (kidclamp)
Modified: 2019-10-14 19:56 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Example (9.97 KB, image/png)
2017-06-07 15:16 UTC, Kyle M Hall (khall)
Details
Bug 15644 - City dropdown default selection when modifying a patron matches only on city (3.96 KB, patch)
2017-06-08 16:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 15644 - City dropdown default selection when modifying a patron matches only on city (3.98 KB, patch)
2017-08-15 12:33 UTC, Amit Gupta
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15644 - City dropdown default selection when modifying a patron matches only on city (4.09 KB, patch)
2017-09-08 17:11 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2016-01-22 15:05:37 UTC
When modifying a patron the dropdown for cities selection tries to select the existing patron's info in the city dropdown menu but matches only on city

For cities with multiple zipcodes, or states with matching city names it can select the wrong info.

This does not affect data entry, but can be confusing to staff.

To recreate:
1 - Enter two cities via Administration->Patrons and circulation->Cities and towns:
    Springfield, MA 01101
    Springfield, VT 05156
2 - Edit a patron chossing Springfield VT
3 - Load thei record in the editor and note that Springfield MA is the selected value in the dropdown

Either we should match on zipcode (unique id?) or default to blank
Comment 1 Kyle M Hall (khall) 2017-06-07 15:16:14 UTC
*** Bug 18744 has been marked as a duplicate of this bug. ***
Comment 2 Kyle M Hall (khall) 2017-06-07 15:16:31 UTC
Created attachment 64082 [details]
Example
Comment 3 Owen Leonard 2017-06-08 16:22:06 UTC
Created attachment 64111 [details] [review]
Bug 15644 - City dropdown default selection when modifying a patron matches only on city

This patch modifies the include files which contain the form fields for
city, state, zipcode, etc. shown on the patron entry screen. The files
are modified so that the city/state/zip <select> preselects a value
based on city, state, and zipcode matching the values in the
corresponding text fields.

To test, confirm that the bug's steps to reproduce are fixed:

- Enter two cities via Administration -> Patrons and circulation
  -> Cities and towns:
    Springfield, MA 01101
    Springfield, VT 05156
- Edit a patron choosing, Springfield VT, and save.
- Edit the patron again and confirm that the correct city is
  pre-selected.
- Confirm this result with all three different settings of the
  "AddressFormat" system preference.
Comment 4 Amit Gupta 2017-08-15 12:33:28 UTC
Created attachment 66010 [details] [review]
Bug 15644 - City dropdown default selection when modifying a  patron matches only on city

Works perfectly.
Comment 5 Nick Clemens (kidclamp) 2017-09-08 17:11:54 UTC
Created attachment 67002 [details] [review]
[SIGNED-OFF] Bug 15644 - City dropdown default selection when modifying a patron matches only on city

This patch modifies the include files which contain the form fields for
city, state, zipcode, etc. shown on the patron entry screen. The files
are modified so that the city/state/zip <select> preselects a value
based on city, state, and zipcode matching the values in the
corresponding text fields.

To test, confirm that the bug's steps to reproduce are fixed:

- Enter two cities via Administration -> Patrons and circulation
  -> Cities and towns:
    Springfield, MA 01101
    Springfield, VT 05156
- Edit a patron choosing, Springfield VT, and save.
- Edit the patron again and confirm that the correct city is
  pre-selected.
- Confirm this result with all three different settings of the
  "AddressFormat" system preference.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2017-09-19 14:48:56 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 7 Fridolin Somers 2017-10-23 14:56:42 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 8 Katrin Fischer 2017-10-29 18:04:24 UTC
This patch has been pushed to 16.11.x and will be in 16.11.14.

Note: French format doesn't exist in 16.11.x and has been removed from the patch.
Comment 9 Mason James 2017-11-23 23:21:02 UTC
Pushed to 16.05.x, for 16.05.19 release