I've been tearing my hair out for the last six hours on this.
I'm migrating a legacy shopping cart system to Drupal Commerce. After upgrading to 2.4 and re-writing all of the code for file migrations, one of my migrations is failing to link during sourceMigration.
The basic setup is: user, a commerce_order entity, and a commerce_billing_profile entity.
- VEUserMigration runs successfully.
- VEOrderBillingProfileMigration runs successfully and populates the map table and the values here are what I expect for sourceid1 and destid1. I don't know if this has any relevance to #1270668: Source Migration destination of multi field mapping is not looked up properly if provided as simple array as I see my migrate_map_veorderbillingprofile has a destid1, destid2 when it should only have destid1?
- VEOrderMigration runs successfully with no notices, but there are no rows created in field_data_commerce_customer_billing, which was mapped with:
$this->addFieldMapping('commerce_customer_billing', 'user_id')
->sourceMigration('VEOrderBillingProfile');
Nothing seems to get set for this value no matter what I try ... defaultValues, etc.
My full migration is here: http://codepad.org/Gek8RAuK
Could you give me a hint as to where I should be looking? Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | entity_api_schema-1605050-3.patch | 524 bytes | mikeryan |
Comments
Comment #1
aidanlis commentedNote: I rolled back to the EntityAPI MigrationDestination from commerce_migrate, as the one bundled in migrate_extras doesn't include half the fields that I want to use: #1604916: Missing setter callbacks for commerce_payment_transaction
Comment #2
mikeryanThe original Entity API handler had getKeySchema defined as a regular method rather than a static method, which is how MigrateDestination (the root class) defines it. I made it static without looking closely - it uses a non-existent $this, so yeah, that's going to cause problems. I need to figure out what problems removing the static keyword will cause...
Comment #3
mikeryanPlease give this a try.
Comment #4
aidanlis commentedI don't notice any difference, but I'm thinking the problem is not about the key schema ... it's completely failing to write any field values. The native columns on the table are fine, but the fieldable values aren't being written.
E.g. for a commerce_line_item entity, I need to put this in my complete():
This wasn't necessary in 2.3 ... any idea what the problematic change could be?
Comment #5
aidanlis commenteddupe
Comment #6
jlenni commentedprobably the same problem. My Media migration doesn't migrate (after upgrade from 2.3->2.4rc1) custom fields on the image entity...
Comment #7
aidanlis commentedThank goodness it's not just me. I was tearing my hair out.
Comment #8
mikeryanjlenni's issue is specific to file/media fields - see #1614318: New file handling loses fields. I have no explanation for the commerce_migrate issue at this time.
Comment #9
mikeryan@jlenni - your problem should be fixed in Migrate 2.4.
Comment #10
aidanlis commentedI re-tried your patch on the latest -dev and I get 100s of array_flip errors suggesting the entities are not being created at all.
Comment #11
mikeryanUltimately, removing the static seems the lesser evil.
Comment #13
dave reidFollowup for this closed issue: #1990216: Using getKeySchema() differs from usage by other destination handlers