- Issue created by @Allie Micka
Airtable bases have unique ids and user-friendly labels.
Each table in a base also has both a unique id and a user-friendly label.
Each field in a base also has this behavior.
For convenience, the initial version of this module only supports user-friendly labels in the base, tables and field names. I think that makes the migration configurations look lovely, but if a base name or a table name is changed, the migration will stop working, which may be unacceptable for some users.
Create an Airtable base, "My Test Base"
Create a table in that base; "My Data"
Create columns in that table: "Thing1", "Thing2"
Create a migration:
id: things
label: "Things from Airtable" # This is a Drupal label, not affected
source:
plugin: airtable
base: 'My Test Base'
table: 'My Data'
constants:
uid: 1
body_format: basic_html
destination:
plugin: entity:node
default_bundle: article
process:
title: Thing1
uid: constants/uid
body/value: Thing2
body/format: constants/body_format
Revist the code in Plugin/migrate/source/Airtable.php to respect either name or id for
I think it would be terrible to use a bunch of random-looking ids in the field-mapping portion of migrate, but we can support either names or ids by setting the field twice in getAirtableFields():
so, this:
$fields[$field->name] = (array) $field;
Becomes this
$fields[$field->name] = (array) $field;
$fields[$field->id] = (array) $field;
Active
1.0
Code