Problem/Motivation
Ubercart D7 product variations need a migration.
Proposed resolution
Refer to the existing D6 migrations.
But for tests, please use the new fixture in #2871812: New complete fixture for Ubercart D7 schema.
Remaining tasks
Do it. There are novice tasks here, details in comment #3.
Write a D7 Product Variation migration test
change all d6_ubercart_product_variation to ubercart_product_variation, after the D7 test is working
Test it.
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | interdiff.txt | 3.54 KB | quietone |
| #20 | 2873500-20.patch | 38.05 KB | quietone |
| #18 | interdiff.txt | 4.96 KB | quietone |
| #18 | 2873500-18.patch | 39 KB | quietone |
| #17 | 2873500-16.patch | 35.54 KB | quietone |
Comments
Comment #2
quietone commentedComment #3
quietone commentedAnd a patch.
Note that this uses the d6_ubercart_product_variation source plugin. And that the d6 and d7 migrations are the same. Therefor there is some renaming work needed. And is suitable for novice.
Next steps (suitable for novice):
Comment #4
quietone commentedComment #5
karthikkumarbodu commentedComment #7
mohit1604 commented@quietone, did changes as per #3, please review it :)
Comment #8
quietone commentedThanks, the patch looks correct. Since this issue was created there are a lot more migrations using the product variation source plugin and the product variation migration and they are looking for d6_ubercart_product_variation and not ubercart_product_variation. Thus many of the test fails with this type of error.
Before fixing all those errors, I think the next step is to write a d7 Migration test to make sure it will work with both d6 and d7 sharing the migration and source plugin. Once that is confirmed then the next step would be to change all the other occurrences of the migration 'd6_ubercart_product_variation' to 'ubercart_product_variation' and similarly for the source plugin, d6_ubercart_product_variation to ubercart_product_variation.
Removing the novice tag for the writing of the new test.
Comment #9
quietone commentedAdded a copy/paste of the D7 product migration test, it still has d6 code in it. The list of things to do in #3 was a bit out of date and so fixed some of the renaming. Created both a d6_ubercart_product_variation.yml and a d7_ubercart_product_variation.yml because of differences in the dependencies.
There will be test failures, but hopefully the d6 ProductVariationTest will pass now.
The next step is to add a MigrateStore helper function to Ubercart7TestBase.php.
Comment #11
quietone commentedA lot has changed since the last patch here. Starting over with a new patch so there is no interdiff.
The code for the source plugins for uc6 and uc7 product variations is the same but the extend from difference base classes, the respective node source plugins. To combine the code here a trait is used. That may not be the best solution.
TODO:
Add non product nodes to the fixture and test that they are not migrated as products.
This needs is postponed on #2995418: [Ubercart D7] Migrate field formatter
Comment #12
quietone commentedNo longer postponed. Adding a test
Comment #13
quietone commentedThis adds a page node to the fixture for testing the product migration, which isn't done here. I got a little ahead of myself. Maybe I should just add the product migration here.
But first, lets test this.
Comment #14
quietone commentedYes, add the product test here. It is just one test and no migration or extra plugins.
Comment #16
quietone commentedDidn't update the product id in the test properly. And remove unused use statement.
Comment #17
quietone commentedAnd the patch.
Comment #18
quietone commentedCombine the d6 and d7 code for node migration in commerce_migrate_ubercart.module
Comment #20
quietone commentedRestore an if statement accidentally removed.
Comment #21
quietone commentedThis is large a copy of the ubercart 6 version with the addition of combining code where possible. Because of that and tests are passing, I'm going to venture an RTBC.
Comment #23
quietone commented