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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Status: Active » Needs review
FileSize
4.68 KB

Something like this.

quietone’s picture

quietone’s picture

This 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.

willeaton’s picture

Hi @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.

willeaton’s picture

I 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

quietone’s picture

FileSize
7.91 KB

The failing tests are being handled in #2894712: Commerce Order Tests failing.

Just uploading an interdiff.

quietone’s picture

@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.

heddn’s picture

Status: Needs review » Needs work

This seems to conflict with #2766679: [Ubercart D6] Create line item migration . Which one should pend so we don't have conflicts?

heddn’s picture

Status: Needs work » Postponed
DamienMcKenna’s picture

Status: Postponed » Needs work

Back 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.