Closed (fixed)
Project:
Address Field
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2013 at 10:22 UTC
Updated:
8 Jul 2016 at 13:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xatoo commentedComment #2
xatoo commentedI've changed the patch to store additional data as a serialized array in the 'data' column so that it can now be used with extensions to address field, (like Address Field Phone.)
Example:
Comment #3
kostajh commentedThis patch worked great for me. Thanks for contributing it!
Even though you've documented this in the code, it might be worth throwing an exception if someone tries to migrate country names that are longer than two characters (or perhaps better, are not valid ISO country codes). As it stands, you'll get SQL errors when trying to migrate "United States" in place of "US".
Comment #4
bc commentedTested and works for me, as well. Thanks for the patch :)
Comment #5
dwkitchen commentedAlso worked for me
Comment #6
rszrama commentedCommitting as is. I'm not sure where such an exception for invalid country codes would go in the Migrate class, but I'd be happy to patch that in if it's an accepted pattern for Migrate classes.
Comment #8
shaundychkoNot sure if this belongs in docs somewhere, but here's a suggested starting point for someone migrating into Address Field with country names in the source. This does Google geocoding since Google can understand typos in the country name, returning DE for "ermany", "Gerany", and other typos. In the migrate constructor use
$this->addFieldMapping('my_destination_address_field', 'country_code');The following takes inspiration from the Geocoder module, and requires it to be enabled with a Google API key entered.