Bug 21794

Summary: Incomplete address displayed on patron details page when City field is empty
Product: Koha Reporter: Lucy Vaux-Harvey <lucy.vaux-harvey>
Component: PatronsAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, gmcharlt, hayleypelham, joonas.kylmala, kyle.m.hall, kyle, marjorie.barry-vila, pierre-marc.thibault, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.04,20.11.10
Circulation function:
Attachments: Bug 21794: Show address information on patron details tab if incomplete
Bug 21794: Fix display of addresses on details tab in staff when city is empty
Bug 21794: Fix display of addresses on details tab in staff when city is empty
Bug 21794: Fix display of addresses on details tab in staff when city is empty
Bug 21794: (QA follow-up) Separate city and country with a comma

Description Lucy Vaux-Harvey 2018-11-08 17:21:28 UTC
On the patron details page at /cgi-bin/koha/members/moremember.pl?borrowernumber=xxxx, if a patron account is missing a value in the City field the rest of the address fields (zipcode, state, country) when filled do not display.
Comment 1 Katrin Fischer 2018-11-08 22:57:00 UTC
Created attachment 82136 [details] [review]
Bug 21794: Show address information on patron details tab if incomplete

To test:
- Enter contact and alternate address without city
- Verify that the address information isn't shown on the details
  tab after saving
- Apply patch
- Verify that the information is displayed now
- Toggly AddressFormat and check display is correct for all settings
Comment 2 Pierre-Marc Thibault 2018-11-09 19:09:33 UTC
I have ", State ZIP/Postal" when State and ZIP/Postal code are filled. I think there should be no comma at the very beginning.
Comment 3 Katrin Fischer 2018-11-10 10:01:12 UTC
It will need a lot of testing for filled variables :) I will have another look!
Comment 4 Katrin Fischer 2021-08-23 22:38:47 UTC
Created attachment 124055 [details] [review]
Bug 21794: Fix display of addresses on details tab in staff when city is empty

If the city field was not filled out on the main or alternate address,
the content of state, country and zipcode wouldn't display on the
Details tab in the patron account in staff.

To test:
- Enter main contact and alternate address without city
- Verify that the address information isn't shown on the details
  tab after saving
- Apply patch
- Verify that the information is displayed now
- Toggle AddressFormat and check display is correct for all settings
- Switch back to US address format
- Try several combinations of empty fields for city, zipcode, country
  and state. The punctuation and whitespace should always appear
  correctly.

Examples:
- Enter just country
- Enter zipcode and country
- ...
Comment 5 Katrin Fischer 2021-08-23 22:39:51 UTC
I had to rewrite the patch completely as we have moved things around quite a bit (for the better) since the first attempt here was made. But I think this should fix the problem with city and also the punctuation issue noted in comment#2
Comment 6 Hayley Pelham 2021-09-02 23:55:48 UTC
Created attachment 124442 [details] [review]
Bug 21794: Fix display of addresses on details tab in staff when city is empty

If the city field was not filled out on the main or alternate address,
the content of state, country and zipcode wouldn't display on the
Details tab in the patron account in staff.

To test:
- Enter main contact and alternate address without city
- Verify that the address information isn't shown on the details
  tab after saving
- Apply patch
- Verify that the information is displayed now
- Toggle AddressFormat and check display is correct for all settings
- Switch back to US address format
- Try several combinations of empty fields for city, zipcode, country
  and state. The punctuation and whitespace should always appear
  correctly.

Examples:
- Enter just country
- Enter zipcode and country
- ...

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Comment 7 Joonas Kylmälä 2021-09-04 18:29:29 UTC
Created attachment 124511 [details] [review]
Bug 21794: Fix display of addresses on details tab in staff when city is empty

If the city field was not filled out on the main or alternate address,
the content of state, country and zipcode wouldn't display on the
Details tab in the patron account in staff.

To test:
- Enter main contact and alternate address without city
- Verify that the address information isn't shown on the details
  tab after saving
- Apply patch
- Verify that the information is displayed now
- Toggle AddressFormat and check display is correct for all settings
- Switch back to US address format
- Try several combinations of empty fields for city, zipcode, country
  and state. The punctuation and whitespace should always appear
  correctly.

Examples:
- Enter just country
- Enter zipcode and country
- ...

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 8 Joonas Kylmälä 2021-09-04 18:29:33 UTC
Created attachment 124512 [details] [review]
Bug 21794: (QA follow-up) Separate city and country with a comma

If only the city and country address information was provided they ended
up being glued together like this: CityCountry. (AddressFormat=US style)

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 9 Katrin Fischer 2021-09-04 23:08:07 UTC
Thank you Hayley and Joonas :)
Comment 10 Jonathan Druart 2021-09-09 09:00:38 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 11 Kyle M Hall (khall) 2021-09-10 12:17:50 UTC
Pushed to 21.05.x for 21.05.04
Comment 12 Fridolin Somers 2021-09-16 07:58:05 UTC
Pushed to 20.11.x for 20.11.10
Comment 13 Victor Grousset/tuxayo 2021-09-20 13:47:19 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.