Problem/Motivation

Currently only order products are coming over but line items (shipping, tax, etc) do not. The line item test should also be updated for this result.

Shipping line items are problematic. mg;aman summarized in #52, "We need shipping line items to migrate to a shipment entity; which will cause the shipping adjustment to populate. Otherwise, if the order is refreshed, all adjustments not "custom" will be removed." This will need some other migrations to run first probably best to move to a separate issue.

Proposed resolution

This issue will migrate all lines items except shipping, that will be done separately.

Add a new generic process plugin, commerce_adjustments, which accepts a nested array of adjustment information and returns a nested array of CommerceAdjusment objects.

Remaining tasks

Review
Commit

CommentFileSizeAuthor
#82 interdiff.txt1.36 KBquietone
#82 2766679-82.patch19.17 KBquietone
#80 2766679-80.patch17.68 KBquietone
#76 interdiff.txt1.28 KBquietone
#76 2766679-76.patch18.51 KBquietone
#75 interdiff.txt18.9 KBquietone
#75 2766679-75.patch18.16 KBquietone
#73 interdiff-71-72.txt2.69 KBquietone
#72 2766679-72.patch13.82 KBquietone
#71 interdiff.txt654 bytesquietone
#71 2766679-71.patch13.83 KBquietone
#69 2766679-69.patch13.72 KBquietone
#67 interdiff.txt2.56 KBquietone
#67 2766679-67.patch14.19 KBquietone
#64 interdiff.txt4.39 KBquietone
#64 2766679-64.patch13.86 KBquietone
#62 interdiff.txt11.47 KBquietone
#62 2766679-62.patch13.32 KBquietone
#60 2766679-60.patch9.83 KBquietone
#54 2766679-54.patch10.32 KBquietone
#49 interdiff.txt2.61 KBquietone
#49 ubercart_d6_create-2766679-49.patch10.65 KBquietone
#48 ubercart_d6_create-2766679-48.patch10.69 KBquietone
#41 interdiff.txt354 bytesquietone
#41 ubercart_d6_create-2766679-41.patch10.75 KBquietone
#37 ubercart_d6_create-2766679-37.patch11.23 KBmglaman
#37 interdiff-2766679-29-37.txt507 bytesmglaman
#35 ubercart_d6_create-2766679-35.patch12.05 KByogeshmpawar
#35 interdiff-2766679-32-35.txt688 bytesyogeshmpawar
#32 interdiff.txt3 KBquietone
#32 2766679-32.patch12.17 KBquietone
#29 2766679-29.patch10.26 KBquietone
#27 interdiff.txt437 bytesquietone
#27 2766679-26.patch10.04 KBquietone
#25 interdiff.txt4.29 KBquietone
#25 2766679-25.patch9.97 KBquietone
#23 2766679-23.patch8.69 KBquietone
#23 interdiff.txt4.12 KBquietone
#19 interdiff.txt1.23 KBquietone
#19 2766679-19.patch8.65 KBquietone
#17 diff.txt1.23 KBquietone
#17 2766679-17.patch8.23 KBquietone
#14 2766679-14.patch8.21 KBquietone
#12 2766679-12.patch6.93 KBquietone
#10 2766679-9.patch9.87 KBquietone
#9 interdiff.txt5.46 KBquietone
#6 2766679-6.patch5.73 KBquietone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

b_sharpe created an issue. See original summary.

quietone’s picture

Parent issue: » #2872836: [Meta] Ubercart 6
quietone’s picture

This looks like the adjustments field on the destination commerce_order_item entity.

And on the source, uc_order_line_items.

quietone’s picture

Status: Active » Needs review

So, I created a new migration with a new source and destination plugin. Ran it and get 'shipping is an invalid adjustment type'. That's right there isn't a shipping adjustment type. Should adjustment types that don't match the existing ones be given type 'Custom' or something else?

mglaman’s picture

Let's check if commerce_shipping is enabled. If it is, let's use `shipping` adjustment type (http://cgit.drupalcode.org/commerce_shipping/tree/commerce_shipping.comm...). Otherwise, yeah let's make it custom.

quietone’s picture

FileSize
5.73 KB

Having some success with this.

TODO: All the source orders have a shipping line item. It would be prudent to test an order that does not include shipping.

There needs to be a test with commerce_shipping enabled. But when I try that locally I get an exception 'The "physical_measurement" plugin does not exist.'. What needs to happen so that plugin is found?

Status: Needs review » Needs work

The last submitted patch, 6: 2766679-6.patch, failed testing. View results

mglaman’s picture

'The "physical_measurement" plugin does not exist.'

Commerce Shipping requires Physical module

quietone’s picture

Status: Needs work » Needs review
FileSize
5.46 KB

@mglaman, thx. I should've seen that.

Patch now with expanded tests and a new test for testing orders with the shipping modules enabled.

quietone’s picture

FileSize
9.87 KB

The patch helps.

Status: Needs review » Needs work

The last submitted patch, 10: 2766679-9.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
6.93 KB

This moves the creation of the Adjustment and Price to a new destination plugin, since that isn't really a transform operation. There are few things to address, such as the currency is hard coded and maybe the test for the presence of commerce_shipping can be moved to a sub-module as suggested in #2871241: Offer submodules that enforce configuration to match specific sources.

Status: Needs review » Needs work

The last submitted patch, 12: 2766679-12.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
8.21 KB

Try again.

mglaman’s picture

Awesome! One concern

+++ b/src/Plugin/migrate/process/ubercart/d6/UbercartLineItem.php
@@ -0,0 +1,44 @@
+            'currency_code' => 'NZD',

This is forcing a currency code which is not the store default, or existing possible currency code.

quietone’s picture

Status: Needs review » Needs work
quietone’s picture

Status: Needs work » Needs review
FileSize
8.23 KB
1.23 KB

Thanks, I completely forgot to go back and fix the currency.

The interdiff failed, but I added a diff since it was small.

quietone’s picture

Status: Needs review » Needs work

Right something has changed, the failing tests have nothing to do with this patch. I was working off core 8.3 and these test pass. But they fail with core 8.4, without this patch.

quietone’s picture

Status: Needs work » Needs review
FileSize
8.65 KB
1.23 KB
quietone’s picture

  • +++ b/src/Plugin/migrate/source/ubercart/d6/Order.php
    @@ -44,20 +79,38 @@ class Order extends SqlBase {
    +    $row->setSourceProperty('currency', $this->getUbercartCurrency());
    

    A possible problem here is that this will conflict with a custom currency migration. Maybe that is only relevant if multiple currencies are in use.

  • +++ b/src/Plugin/migrate/source/ubercart/d6/Order.php
    @@ -69,4 +122,19 @@ class Order extends SqlBase {
    +  public function getUbercartCurrency() {
    

This is simple enough that a new method isn't needed.

willeaton’s picture

A possible problem here is that this will conflict with a custom currency migration. Maybe that is only relevant if multiple currencies are in use.

In Drupal 6 I think it was very difficult to achieve multiple currencies unless you had multisites (as one of my sites does). As D6 ubercart did not save currencies in the order, or store, but in the site variables I think its safe to load it from D6 variables which I believe is what this line is doing (correct me if Im wrong)...

$this->variableGet('uc_currency_code', 'USD');
This is simple enough that a new method isn't needed.

Not sure I understand, are you saying that we shouldn't add it or that we can reuse the same method from elsewhere?

Please note that some of my changes seem to be removed from the patch 2888764-6.patch. In getAdjustmentData() I added a freach on teh adjustments to add the missing currency. The order save was throwing up loads of errors in Price.php because we are not passing the currency. Maybe this is staying in the other case...? https://www.drupal.org/node/2888764

quietone’s picture

Assigned: Unassigned » quietone

Assigning to myself for review.

quietone’s picture

Assigned: quietone » Unassigned
FileSize
4.12 KB
8.69 KB

@willeaton, thanks for the information about Ubercart currencies. That keeps things simple.

Re the VariableGet, I mean we can put the VariableGet in prepareRow(). Which I have done in this patch. Also, there is a bit of renaming and the source plugin extends from DrupalSqlBase instead of SqlBase.

I have restored the setting of the currency_code in prepareRow. To be consistent we should, ideally, get the currency from the currency migration, which this is dependent on. But, as explained in #21, that isn't necessary in this case.

heddn’s picture

Status: Needs review » Needs work

I think some of my feedback would be address with a re-roll now that #2894123: Move commerce to submodule has landed.

  1. +++ b/src/Plugin/migrate/destination/ubercart/d6/EntityOrder.php
    @@ -0,0 +1,35 @@
    +namespace Drupal\commerce_migrate\Plugin\migrate\destination\ubercart\d6;
    ...
    +class EntityOrder extends EntityContentBase {
    

    Shouldn't this be called simply Order and not be placed in a uc6 sub-folder? This is the destination and we want the destinations to be re-usable.

  2. +++ b/src/Plugin/migrate/destination/ubercart/d6/EntityOrder.php
    @@ -0,0 +1,35 @@
    +    $values = $row->getDestinationProperty('adjustments');
    +    if ($values) {
    +      $adjustments = [];
    +      foreach ($values as $adjustment) {
    +        $adjustment['amount'] = new Price($adjustment['amount']['number'], $adjustment['amount']['currency_code']);
    +        $adjustments[] = new Adjustment($adjustment);
    +      }
    +      $row->setDestinationProperty('adjustments', $adjustments);
    
    +++ b/src/Plugin/migrate/process/ubercart/d6/UbercartLineItem.php
    @@ -0,0 +1,44 @@
    +      foreach ($value as $adjustment) {
    +        $adjust = [];
    +        $adjust['delta'] = $i++;
    +        $adjust['type'] = 'custom';
    +        $adjust['label'] = $adjustment['title'];
    +        $adjust['amount'] =
    +          [
    +            'number' => $adjustment['amount'],
    +            'currency_code' => $adjustment['currency_code'],
    +          ];
    +        // @TODO: Adjustment sourceId and included.
    +        $adjustments[] = $adjust;
    

    I wondered here for a moment if it made sense to tie the source data so closely to what the destination order is expected. But after looking at it, I think it makes sense.

    OK, I take that back now. Why don't we just do everything in the process plugin for adjustments. Why do we need the altered destination and pre-import stuff.

  3. +++ b/src/Plugin/migrate/process/ubercart/d6/UbercartLineItem.php
    @@ -0,0 +1,44 @@
    +        // @TODO: Adjustment sourceId and included.
    

    This @TODO isn't clear what is needed to be done.

  4. +++ b/src/Plugin/migrate/source/ubercart/d6/Order.php
    @@ -44,20 +81,44 @@ class Order extends SqlBase {
         // Ubercart 6 stores credit card information in a hash. Since this probably
    ...
    +    $row->setSourceProperty('commerce_shipping', $this->moduleHandler->moduleExists('commerce_shipping'));
    

    This seems out of place here. Or at least a comment could help explain why we need the boolean.

quietone’s picture

Status: Needs work » Needs review
FileSize
9.97 KB
4.29 KB

1. Destination plugin gone.
2. Moved the creation of the Price and Adjustment to the process plugin.
3. The TODO was actually a note to myself, not meant to be left in the code.
4. Comment added. And thanks, this lead me to realize that the code using the commerce_shipping source value was missing. It is restored now and a test added to check the adjustment type is 'shipping' when commerce_shipping is enabled on the source.

Status: Needs review » Needs work

The last submitted patch, 25: 2766679-25.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
10.04 KB
437 bytes

Added '@requires module' to the annotation in the test.

Status: Needs review » Needs work

The last submitted patch, 27: 2766679-26.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
10.26 KB

Reroll. Including moving some files to the newish ubercart submodule.

Status: Needs review » Needs work

The last submitted patch, 29: 2766679-29.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review

Failure is

1) Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\d6\OrderShippingTest::testOrder
PHPUnit_Framework_Exception: Unavailable module: 'commerce_shipping'. If this module needs to be downloaded separately, annotate the test class with '@requires module commerce_shipping'.

But the @requires is there.

Note the test passes locally, where the required modules are present.

quietone’s picture

FileSize
12.17 KB
3 KB

The @requires doesn't appear to do anything. I looked at there is https://www.drupal.org/node/2728579, https://www.drupal.org/node/1273478 and a draft CR https://www.drupal.org/node/2857979 (which isn't very clear to me) All up, no indication of what to do now with such a test. Asked in #drupal-contribute, larowlan wasn't sure either.

So, I decided to put it into a submodule. It works locally.

Status: Needs review » Needs work

The last submitted patch, 32: 2766679-32.patch, failed testing. View results

mglaman’s picture

Per #31 I'd like to talk to the PHPUnit people or Mixologic.

yogeshmpawar’s picture

Status: Needs work » Needs review
FileSize
688 bytes
12.05 KB

updated patch as per proposed solution in https://www.drupal.org/node/2728579. maybe it will clear test fails.

Status: Needs review » Needs work

The last submitted patch, 35: ubercart_d6_create-2766679-35.patch, failed testing. View results

mglaman’s picture

Status: Needs work » Needs review
FileSize
507 bytes
11.23 KB

Here is an attempt to add require-dev. it's proven that @require does not work, and when talking to dawehner defining test_dependency will not work until we tag a release.

mglaman’s picture

+++ b/composer.json
@@ -3,9 +3,12 @@
+        "drupal/coder": "^8",
+        "drupal/commerce_shipping": "~2.0"

I'm fine adding this as a dev dependency. This is really just a development module, anyways.

willeaton’s picture

Real life test seems to work. I see custom line items imported without issues! Ready for dev?

heddn’s picture

Status: Needs review » Needs work
  1. +++ b/composer.json
    @@ -3,9 +3,12 @@
    +        "drupal/commerce_shipping": "~2.0"
    

    Nit: probably should be ^ instead of ~.

  2. +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderShippingTest.php
    @@ -0,0 +1,89 @@
    +  public function testOrder() {
    

    Nit: could this use a data provider?

  3. +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderTest.php
    @@ -54,9 +56,30 @@ class OrderTest extends Ubercart6TestBase {
    +      'label' => 'Shipping',
    

    Why are we testing this in two places? Isn't a single place enough?

quietone’s picture

Status: Needs work » Needs review
FileSize
10.75 KB
354 bytes

1.Fixed
2. No, don't think so. Discussed this on IRC and we agree that dataproviders are useful, and preferred, but the don't really suite the migration environment and will make it difficult to find what item is causing the error. However, we should have a follow up to add the adjustments and cc_data to the assertOrder method. The adjusments aren't tested in commerce, so we can deal with all that in the followup.
3. Because 'test all the things'. And, the fixtures change over time, we should continue to confirm that the adjusment is correct.

quietone’s picture

heddn’s picture

Status: Needs review » Needs work

That's a little strange. Back in #37, there's a testOrder method. But it isn't there in #41. Did we drop something?

quietone’s picture

Status: Needs work » Needs review

We didn't drop anything. The original OrderTest::testOrder is still there and so is the new on OrderShippingTest::testOrder. I double checked and applied the patch.

heddn’s picture

Status: Needs review » Needs work
  1. +++ b/modules/ubercart/src/Plugin/migrate/process/d6/UbercartLineItem.php
    @@ -0,0 +1,46 @@
    +        $adjust['type'] = $row->getSourceProperty('commerce_shipping') ? 'shipping' : 'custom';
    
    +++ b/modules/ubercart/src/Plugin/migrate/source/d6/Order.php
    @@ -45,20 +82,45 @@ class Order extends SqlBase {
    +    // The line item type depends on whether commerce_shipping is installed.
    +    // Save the state here for the UbercartLineItem process plugin.
    +    $row->setSourceProperty('commerce_shipping', $this->moduleHandler->moduleExists('commerce_shipping'));
    

    A comment about why if commerce shipping is installed we assume that the line item is a shipping would be helpful. There are non-shipping line items too, so documenting why we can safely assume all line items are shipping would be good. Or even better, do it in both places and improve the comment in Order::prepareRow().

  2. +++ b/modules/ubercart/src/Plugin/migrate/source/d6/Order.php
    copy from modules/ubercart/tests/src/Kernel/Migrate/d6/OrderTest.php
    copy to modules/ubercart/tests/src/Kernel/Migrate/d6/OrderShippingTest.php
    

    I see why I didn't see the testOrder method. Git thought this was a copy.

  3. +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderShippingTest.php
    @@ -23,6 +26,9 @@ class OrderTest extends Ubercart6TestBase {
    +    'physical',
    

    I don't see this module listed as a test dependency in composer.json

  4. +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderShippingTest.php
    @@ -54,9 +60,30 @@ class OrderTest extends Ubercart6TestBase {
    +      'amount' => new Price('2.99', 'NZD'),
    ...
    +      'amount' => new Price('1000.00', 'NZD'),
    
    +++ b/modules/ubercart/tests/src/Kernel/Migrate/d6/OrderTest.php
    @@ -54,9 +56,30 @@ class OrderTest extends Ubercart6TestBase {
    +      'amount' => new Price('2.99', 'NZD'),
    ...
    +      'amount' => new Price('1000.00', 'NZD'),
    +++ b/modules/ubercart/src/Plugin/migrate/source/d6/Order.php
    @@ -45,20 +82,45 @@ class Order extends SqlBase {
    +    $currency_code = $this->variableGet('uc_currency_code', 'USD');
    

    I see this coming through in the fixture, but I don't see where we test the default currency code of USD coming from . I don't see test coverage of this. All the scenarios use NZD.

quietone’s picture

Status: Needs work » Needs review

1. Not really sure about this. I implement what @mglaman suggested in #5
2. Oh yes, I copied it.
3. It is a dependency of commerce_shipping, doesn't composer pick that up from the commerce_shipping composer.json?
4. To test the default currency the source db needs to be modified. Is this necessary? I don't recall this being done in core for all the variable defaults.

heddn’s picture

Hmm, so what if our process plugin to create the adjustment also accepted the adjustment type? Then in the source we set the type to shipping or custom. Then the process plugin is more reusable.

quietone’s picture

Start with a reroll.

quietone’s picture

Implemented suggested changes in #47.

heddn’s picture

Status: Needs review » Needs work
  1. +++ b/modules/ubercart/src/Plugin/migrate/process/d6/UbercartLineItem.php
    @@ -0,0 +1,45 @@
    +        $adjust['type'] = $adjustment['type'];
    +        $adjust['label'] = $adjustment['title'];
    ...
    +          'number' => $adjustment['amount'],
    +          'currency_code' => $adjustment['currency_code'],
    

    So, we have 'type', 'title', 'amount', 'currency_code' in a nested array. If we want to make this process plugin re-usable for any and all line items, not just uc6, are those the best key names? They seem ok to me.

    So, the last thing then is to move this up to commerce_migrate as a re-usable process plugin. Naming... what about 'commerce_adjustments' / CommerceAdjustments? Plural because it seems to return an array of adjustments.

  2. +++ b/modules/ubercart/src/Plugin/migrate/source/d6/Order.php
    @@ -112,10 +109,14 @@ class Order extends DrupalSqlBase {
    +    // The line item type depends on whether commerce_shipping is installed.
    +    // Save the state here for the UbercartLineItem process plugin.
    

    Some type of comment to the effect that by default the destination has custom adjustments in core and shipping if shipping module is enabled. But other adjustment types are possible, just not bundled with the vanilla migration. Maybe @mglaman can comment here with some better wording. For example from the IS, tax are also an adjustment. Are we just mapping them to custom? That seems strange.

mglaman’s picture

are those the best key names? They seem ok to me.

Yes, here are the keys defined for adjustment value object: https://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/order/sr...

    $this->type = $definition['type'];
    $this->label = $definition['label'];
    $this->amount = $definition['amount'];
    $this->percentage = !empty($definition['percentage']) ? $definition['percentage'] : NULL;
    $this->sourceId = !empty($definition['source_id']) ? $definition['source_id'] : NULL;
    $this->included = !empty($definition['included']);

Adjustment mapping:

Taxes were never line items in 1.x; not sure Ubercart. In Ubercart and 1.x shipping is a line item, which we can and should migrate to shipping adjustment type. Anythign non-product should be custom for now. People can run alters to say "fee" or whatever else.

mglaman’s picture

Actually. There's a new curveball here for shipping line items.

We need shipping line items to migrate to a shipment entity; which will cause the shipping adjustment to populate. Otherwise, if the order is refreshed, all adjustments not "custom" will be removed.

Confirmed with bojanz.

I'm not sure where to go. Perhaps we need a deriver which creates migrations per line item type discovered? Like the Node migration does. And have shipping line items go off and create shipment entities. This is where I'm not sure.

quietone’s picture

Finally, getting back to this.

Perhaps we need a deriver which creates migrations per line item type discovered?

I think that means that that each line item where the type and title form a unique set get migrated to a 'something'. I say 'something' because if type = 'shipping' then I am guessing it will always (?) be migrated to a shipping method. Then if type = 'tax' then it gets migrated to a tax type?, not sure about that.
I don't think this will work. Let's use shipping as the example. The uc_order_line_item contains the type (shipping) and the title (Acme transport). That isn't sufficient to determine the shipping plugin to use. At least this is true for Flat Rate service, which is the only shipping service I've explored. Maybe this is doable for many 'standard' services where perhaps a static map could be used to determine the plugin? Would that work? Possibly not as both the type field and title field are alterable by the user.

In the meantime, I've made migrations for the Flat Rate service for both Ubercart 6 and Commerce 1. I've yet to try them out with the patch here which surely needs a reroll.

quietone’s picture

Status: Needs work » Needs review
FileSize
10.32 KB

Rerolled but it will fail tests.

Status: Needs review » Needs work

The last submitted patch, 54: 2766679-54.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

quietone’s picture

And have shipping line items go off and create shipment entities. This is where I'm not sure.

Tried that anyway and turns out the shipment needs the order_id and it is a required field.
Required shipment field "order_id" is empty.

So, migrate the non shipping line items, then migrate the order, and the migrate shipping line items? Or can the shipping information be included in the order migration and will that automatically create the shipment entity?

quietone’s picture

We need shipping line items to migrate to a shipment entity;

How does this happen in Commerce 2? What does one due to create a shipment entity? I was thinking this might happen if a flat rate service was to be applied to all orders but the shipping is never applied to the order. The order type is 'default' and set to shippable as are all the product variations.

joachim’s picture

> How does this happen in Commerce 2? What does one due to create a shipment entity? I

That is a really good question!

I've just spent 5-10 minutes going through the code of the Commerce Shipping module, and I can't find where the shipment entities are actually created! The only call to create() I can see is in PackManager::packToShipments(), but that gets the shipments already in the order... I suspect that the first time that's called, the shipments array from the order is empty, and it's designed so that subsequent calls re-pack the order.

In which case, the creation of shipments is done when the ShippingInformation pane form is loaded.

If that doesn't happen (because we're migrating orders so the checkout UI isn't loaded), the subsequent order refresh calls to ShipmentOrderProcessor will have no effect, because that has a guard clause to check whether the order has any shipments at all.

So I reckon that during a migration, no shipment entities will be created.

heddn’s picture

The code to add a shipment is scattered all over. I had to pull it all together over in #2961463: Multiple destination shipping though, so you should see a manual way to pull it all together. Specifically, MultipleDestinationsForm:submitForm(). One thing of note, the ShippingOrderProcessor has shouldRepack(). This checks if 'owned_by_packer' is set. I think in our case, we don't want it set, but we do want to make sure payments are added on re-processing. We just don't want the packer to do it.

quietone’s picture

Status: Needs work » Needs review
FileSize
9.83 KB

Needed a reroll.

Status: Needs review » Needs work

The last submitted patch, 60: 2766679-60.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
13.32 KB
11.47 KB

This was all about getting the test to pass. The adjustments array has been removed for assertOrder since the adjustment is an object containing another object as well, the price, the assertSame didn't like it. Asserting the adjustments is done separately now. Since the assertion on the adjustment has been removed from assertOrder the other usages needed to be changed as well.

Status: Needs review » Needs work

The last submitted patch, 62: 2766679-62.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

quietone’s picture

Status: Needs work » Needs review
FileSize
13.86 KB
4.39 KB

Rework the way the adjustment type is chosen in the source plugin and then updated the source plugin accordingly. The source plugin now gets the status of commerce_shipping module once and then only tests if 'shipping' needs to be changed to custom if the type is 'shipping'.
Also removed OrderShippingTest, it appears to be the start of a test to check just shipping and that idea isn't needed, we can test the adjustments in the order.

quietone’s picture

+++ b/modules/ubercart/src/Plugin/migrate/source/uc6/Order.php
@@ -17,9 +22,47 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
+  /**

insert a blank line

I don't think the points in #50 and #51 have been addressed.

heddn’s picture

Status: Needs review » Needs work

Back to NW for #50/#51/#59

quietone’s picture

Status: Needs work » Needs review
FileSize
14.19 KB
2.56 KB

The addresses #50 and #51. The process plugin has been moved to commerce_migrate and comment slightly improved in the Order source plugin.

Status: Needs review » Needs work

The last submitted patch, 67: 2766679-67.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
13.72 KB

Starting over, beginning with a reroll of the patch in #64.

Status: Needs review » Needs work

The last submitted patch, 69: 2766679-69.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

quietone’s picture

Status: Needs work » Needs review
FileSize
13.83 KB
654 bytes

Odd, that one line didn't get updated in the reroll process.

quietone’s picture

FileSize
13.82 KB

Reapply the fixes for #50 and #51 from #67.

quietone’s picture

FileSize
2.69 KB

The interdiff for the above patch

quietone’s picture

Issue summary: View changes

Update the IS

quietone’s picture

FileSize
18.16 KB
18.9 KB

Now address #59 by suggesting that shipping be done in a follow up.

This patch adds tax line items and a 'service charge' line item and migrates them as part of the order. The order tests are updated to test these adjustments.

quietone’s picture

FileSize
18.51 KB
1.28 KB

Some cleanup.

quietone’s picture

Follow up made to handle shipping line items. #2992272: Migrate shipping line items to order adjustments

heddn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now.

quietone’s picture

Sweet! 'Tis a day when some good news is needed too, extra bonus for that.

quietone’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
17.68 KB

Needs reroll

Status: Needs review » Needs work

The last submitted patch, 80: 2766679-80.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

quietone’s picture

Status: Needs work » Needs review
FileSize
19.17 KB
1.36 KB

Looks like I missed a file in that patch.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

Tests passing, since this was just a reroll setting back to RTBC.

  • quietone authored daf7f76 on 8.x-2.x
    Issue #2766679 by quietone, mglaman, yogeshmpawar, heddn, willeaton: [...
quietone’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.