I'm trying to migrate multilingual taxonomies with additional fields. Some of words fully similar in different languages therefore MigrateDestinationTerm just change the language of the existing term and translate additional fields.
About other MigrateDestination can not say anything, but they will be the same confusion.
So I decide if possible specify MigrateSQLMap subfields, for example specify a language.

Comments

mikeryan’s picture

Assigned: veh » Unassigned
Category: Feature request » Support request
Status: Active » Postponed (maintainer needs more info)

The issue is that you need the language in addition to the ID to uniquely identify items, correct? You can add additional columns to the keys in MigrateSQLMap:

    $this->map = new MigrateSQLMap($this->machineName,
        array(
          'style' => array('type' => 'varchar',
                           'length' => 255,
                           'not null' => TRUE,
                           'description' => 'Topic ID',
                          ),
          'style_language' => array('type' => 'varchar',
                           'length' => 3,
                           'not null' => TRUE,
                           'description' => 'Language of the style',
                          ),
        ),
        MigrateDestinationTerm::getKeySchema()
      );

This will give you both sourceid1 and sourceid2 in the map table.

veh’s picture

I migrate data from csv file where columns are language-based term fields. Can I set value for sourceid2 directly in the MigrateSQLMap? Or I need to create columns to check language?
I set language in MigrateDestinationTerm::options.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Active

When providing more info to an issue marked "Postponed (maintainer needs more info)", be sure to set the status back to Active for more visibility.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

In my example, above, 'style' and 'style_language' represent columns from your source data. So, if your CSV file looks something like:

style,style_language
School,en
Ecole,fr

then the map table would be populated like

sourceid1 sourceid2 destid1
School en 43
Ecole fr 44

where the destid1 values are the Drupal term IDs created for each term.

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.