Problem
The new address custom field format is missing the subpremise property. This is a problem with addresses that include apartment numbers.
The migration guide to v2 incorrectly claims that subpremise was always null in v1 and was thus removed. See here.
Example/How to reproduce
Create a new person with an address custom field and use “Pfefferhofgasse 6/11, 1030 Wien” as the address. Use the Google popup to ensure that the address is correctly parsed.
API v1 returns this in the persons data:
"87f9d077a4348f528c958cdf2d48547aa5eefbc2": "Pfefferhofgasse 6\/11, Wien, \u00d6sterreich",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_subpremise": "11", <--------- CORRECT SUBPREMISE
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_street_number": "6",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_route": "Pfefferhofgasse",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_sublocality": "Landstra\u00dfe",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_locality": "Wien",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_admin_area_level_1": "Wien",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_admin_area_level_2": "Wien",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_country": "\u00d6sterreich",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_postal_code": "1030",
"87f9d077a4348f528c958cdf2d48547aa5eefbc2_formatted_address": "Pfefferhofgasse 6\/11, 1030 Wien, \u00d6sterreich",
Note the subpremise in line 2.
API v2 returns the new address custom format
'87f9d077a4348f528c958cdf2d48547aa5eefbc2' =>
array (
'value' => 'Pfefferhofgasse 6/11, Wien, Österreich',
'street_number' => '6',
'route' => 'Pfefferhofgasse',
'sublocality' => 'Landstraße',
'locality' => 'Wien',
'admin_area_level_1' => 'Wien',
'admin_area_level_2' => 'Wien',
'country' => 'Österreich',
'postal_code' => '1030',
'formatted_address' => 'Pfefferhofgasse 6/11, 1030 Wien, Österreich',
),
The subpremise is missing and the apartment number can not be parsed from the response anymore.
How to fix
Add the subpremise back to the address custom format