Closed (duplicate)
Project:
Migrate Extras
Version:
7.x-2.x-dev
Component:
Migrate Extras Features
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2011 at 08:02 UTC
Updated:
26 Sep 2012 at 01:33 UTC
I am trying to migrate content using the Migrate module. But it seems that Countries doesn't integrate with Migrate:
$this->addFieldMapping('field_adress_country', 'country');
This is the way to import a field and it works with others. But the Countries field stays empty. You can set it manually:
$node->field_adress_country['und']['0']['value'] = $row->country;
But this doesn't work either. What is necessary to get this working? Nice would be an integration.
Thanks
Lukas
Comments
Comment #1
luksakI resloved the issue:
$node->field_adress_country['und']['0']['iso2'] = $row->country;But integration would be nice.
Comment #2
johnvPerhaps we should re-open #1153130: Normalize field values (safe -> safe_value; value).
Comment #3
alan d. commentedThere will be a hook to implement to import the data. The resulting code inside this would probably look like:
This function tries to load a country without knowing what property is being passed in. So iso2, iso3, number code or even name (if these match) would return an iso2 code.
Comment #4
alan d. commentedBumping queues:
The request is for Countries module support. This module provides a fieldable country bundle that has country fields. This country field information by iso2 value:
Internally, this module supports a number of methods to calculate the country iso2 value from other properties.
The method above (in comment #3) is probably the easiest way as it is not dependent on any one property.
I can not see any use-cases where the country entities would ever need importation.
@Lukas von Blarer
There are partially documented processes on the Migrate / Migrate Extras pages if you want to tackle this faster using a custom implementation.
Comment #5
luksakThank you! I will try this.
Comment #6
alan d. commentedThis should be handled internally now, see #1378662: Add support for Migrate API