Issue 14317

Null Country getting converted into iso code "ZZ"

14317
Reporter: kbraak
Assignee: kbraak
Type: Bug
Summary: Null Country getting converted into iso code "ZZ" 
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2013-10-30 15:51:25.598
Updated: 2013-12-16 17:50:49.838
Resolved: 2013-11-05 10:15:35.998
        
Description: In the Registry API, Address.country is nullable, Organization.country is nullable, and Node.country is nullable.

So unless the iso code persisted is actually "ZZ", the field should not be populated and left null.

Fortunately, steps were taken in PF-168 to make sure the contact's unknown country does not get displayed in the portal.

This is evidence of how our registry ws are returning contacts' with a null country right now: http://api.gbif.org/v0.9/organization/f9b67ad0-9c9b-11d9-b9db-b8a03c50a862/contact

This is evidence that a contact with proper iso code returns fine: http://api.gbif.org/v0.9/organization/730cd32c-627f-44a8-9d93-fcfb23ade969/contact]]>
    


Author: ahahn@gbif.org
Comment: According to http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm, there is no valid Iso country code of ZZ. Unless there was a good reason that this dummy was introduced, I would propose to reset all such values to NULL.
Created: 2013-10-30 16:00:21.136
Updated: 2013-10-30 16:00:21.136


Author: kbraak@gbif.org
Comment: The root of the problem is in the common-mybatis' CountryConverter class. A fix is under review here: http://dev.gbif.org/code/cru/CR-POR-153
Created: 2013-10-30 17:17:06.333
Updated: 2013-10-30 17:17:06.333


Author: kbraak@gbif.org
Comment: Review complete, and changes committed: https://code.google.com/p/gbif-registry/source/detail?r=3519
Created: 2013-11-01 16:52:14.012
Updated: 2013-11-01 16:52:14.012


Author: kbraak@gbif.org
Comment: Fixed on staging. 
Created: 2013-11-05 10:15:36.031
Updated: 2013-11-05 10:15:36.031