Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Product attributes and their options need a migration. The db tables are:
- uc_attributes - defines the attribute name, label, ordering, require, display type(text, checkbox etc) and description.
- uc_attribute_options - the option, cost, price, weight, and ordering.
- uc_product_attributes links the attribute to a product.
Proposed resolution
Create field storage from uc_attributes - added in patch #3
Migrate the product attribute - added in patch #4
Migrate the product attribute options - added in patch #6
Remaining tasks
Review
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#23 | 2893389-23.patch | 19.17 KB | quietone |
#23 | interdiff.txt | 2.65 KB | quietone |
#21 | interdiff.txt | 7.36 KB | quietone |
#21 | 2893389-21.patch | 19.31 KB | quietone |
#20 | 2893389-20.patch | 19.17 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone commentedComment #3
quietone CreditAttribution: quietone commentedFor the field storage
Comment #4
quietone CreditAttribution: quietone commentedAdd in the migration of the product attribute. This doesn't include the attribute options. This is rough, the docs are incomplete and I'm not sure about the elementType in the migration. That needs more testing.
Comment #5
quietone CreditAttribution: quietone commentedThat was odd, I am sure I uploaded the patch. Anyway, here it is.
Comment #6
quietone CreditAttribution: quietone commentedComment #7
quietone CreditAttribution: quietone commentedComment #8
quietone CreditAttribution: quietone commentedChange migration label to start with 'Ubercart' so they will be easier to find in the config UI. Correct doc comments
Comment #9
quietone CreditAttribution: quietone commentedMoving product migrations to major.
Comment #10
quietone CreditAttribution: quietone commentedMove the changes to the ubercart submodule.
Comment #11
quietone CreditAttribution: quietone commentedAdded source_provider to the source plugin annotation.
Comment #13
quietone CreditAttribution: quietone commentedThe test aborted. Passes on retest.
Comment #14
heddnCan we call this d6_ubercart_attribute_field_config, or some such? It took me a while to figure out this was different than d6_ubercart_product_attribute
Can we just call this Ubercart and drop the D6 part?
Are we sure that it 'en' is the only language possible?
Should a default value be provided? Just asking, I don't know the answer.
Comment #15
quietone CreditAttribution: quietone at Acro Commerce commentedOnly fixed #2.
Comment #16
quietone CreditAttribution: quietone at Acro Commerce commentedSilly me, I didn't upload the patch.
Comment #17
quietone CreditAttribution: quietone at Acro Commerce commentedBack to needs work for #14.1, #14.3 and #14.4.
Comment #18
quietone CreditAttribution: quietone at Acro Commerce commentedFirst, reroll.
Comment #19
quietone CreditAttribution: quietone at Acro Commerce commentedLet's try that reroll again.
Comment #20
quietone CreditAttribution: quietone at Acro Commerce commentedOh, you've got to be kidding. I fixed that.
Comment #21
quietone CreditAttribution: quietone at Acro Commerce commented14.1. Rename d6_ubercart_attribute to d6_ubercart_field_attribute. I chose that because core d6_field write the field config and it puts emphasis on the field rather than the specific field, attribute.
14.3. Don't know about other languages and fields. Core has settled on using configuration 'translations: true' for migrations translations and having a separate migration for the translations. I grabbed langcode pattern from core d6_field. There is issue about translatable fields which has just the one comment from mikeryan. #2789927: How to migrate translatable fields?
#14.4. Don't think it needs a default value. But can be convinced otherwise. Anyone have an example where a default is needed/helpful? Added a comment in the yml about where the data comes from.
Removed migration_groups from the migrations, moved the new assertions to be alphabetical in the CommerceMigrateTestTrait.
Comment #22
heddnJust some small nits.
Nit: Available.
Can we drop the 'expected_' part from the variable name?
Comment #23
quietone CreditAttribution: quietone at Acro Commerce commented1. Fixed
2. Old habit. Yes, expected_ has been removed.
Comment #24
heddnComment #26
heddn