In the construct for MigrateDestinationEntityAPI (entity_api.inc), $this->id is set to $this->info['entity keys']['name'] if available, or $this->info['entity keys']['id'] otherwise. However, in the import() function, it assumes that the value of this field will be numeric, which it isn't always (e.g. Bean module).
This causes the following message to be output for each item being migrated, even though the migration is successful. It also causes the "destid1" field in the map table to be NULL.
New object was not saved, no error provided
The attached patch changes the conditional from an isset() and a check that the value is greater than 0, to a if (!empty(...)) which fixes the problem for me.
| Comment | File | Size | Author |
|---|---|---|---|
| migrate_extras_entity_api_entity_keys_name.patch | 441 bytes | stella |
Comments
Comment #1
pvhee commentedConfirming that this works, although I could not yet get the updating of existing bean blocks to work. Maybe we need a separate Bean MigrationDestination class?
Comment #2
SebCorbin commentedDuplicate of #1890022: EntityAPI Import expects serial data type as entity id
Comment #3
SebCorbin commentedTo migrate beans, see #2141211: Bean Migrate example