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
The line item migration #2766679: [Ubercart D6] Create line item migration currently has the default store currency hard coded. Obviously, this isn't a good idea. The currency migration has already run and we want to get the result. But there is also #2854052: D6 ubercart OrderProduct currency error ,which doesn't have the currency in the source as expected. They both need the currency value. And that just got me thinking about a more generic solution.
Proposed resolution
A new process plugin that can determines the default currency based on the order/store information in the row.
Remaining tasks
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-4-6.txt | 7.91 KB | quietone |
#6 | 2888764-6.patch | 11.36 KB | willeaton |
#5 | 2888764-5.patch | 11.5 KB | willeaton |
#4 | 2888764-4.patch | 3.43 KB | quietone |
| |||
#2 | 2888764-2.patch | 4.68 KB | quietone |
|
Comments
Comment #2
quietone CreditAttribution: quietone commentedSomething like this.
Comment #3
quietone CreditAttribution: quietone commentedBlocking #2887231: [Ubercart] Migrate payments
Comment #4
quietone CreditAttribution: quietone commentedThis can be a lot simpler. Threw it out and started again. This process plugin has configuration argument, 'parameter', which signifies what type of id the value is. Parameter can be either 'store_id' or 'order_id'. And the source value is the actual number. This gives some flexibility in getting a stores default currency and hopefully some bit of future proofing.
Comment #5
willeaton CreditAttribution: willeaton commentedHi @quietone
Order.php is still trying to fetch the currency from the D6 database, I've implemented something similar to what you implemented for product variation. See if you think it looks ok. I get a load of errors for order line items where the value and currency is empty but this might be normal.
Comment #6
willeaton CreditAttribution: willeaton commentedI made a few more fixes, with this I was finally able to import orders, products, and line items. All issues were currency related. Lets see if Drupal.org likes this patch
Comment #7
quietone CreditAttribution: quietone commentedThe failing tests are being handled in #2894712: Commerce Order Tests failing.
Just uploading an interdiff.
Comment #8
quietone CreditAttribution: quietone commented@willeaton, glad you were able to import everything. Good to know it works.
Here we are just looking at a process plugin for the default store currency and the patch in #6 goes beyond that. Since It includes the work in #2766679: [Ubercart D6] Create line item migration , let's move it over there.
Comment #9
heddnThis seems to conflict with #2766679: [Ubercart D6] Create line item migration . Which one should pend so we don't have conflicts?
Comment #10
heddnI'm going to postpone this on #2766679: [Ubercart D6] Create line item migration .
Comment #11
DamienMcKennaBack to "needs work" - in a site I just did a test migration it created a currency and default store but failed to set the currency for the store.