I've noticed a product kit often losing its sort order. It goes back to some funky sort order, and all the row weights are 0. I edit the kit to set the order how it has to be. It seems fine. When I check later, the product order is messed up again.

These are products kits for which I have been editing the individual products. That might have something to do with it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jordan_Fei’s picture

Hi DanZ,

I just wonder how to set the order of a kit, if you don't set it via row weights?

I am willing to fix this bug if I can duplicate this bug. So if possible, could you provide a simple test example?

Thanks,
DanZ

DanZ’s picture

Make a kit with multiple products.

Save the kit.

Edit the kit. There's an option (with row weights or without) to change the order of the products in the kit. Change the order.

Save the kit again.

Edit, modify, and save one of the products in the kit. Any change seems to do it.

View the kit. The row weights reverted to whatever they were before before you changed them.

Edit the kit. All the row weights are 0.

Jordan_Fei’s picture

Status: Active » Needs review
FileSize
1.56 KB

hi DanZ,

Thanks for your test case. I did a patch to fix this bug. Please review and test it.

Regards,
Jordan

DanZ’s picture

I tested this and it solved the problem.

I'd call this "Reviewed and tested by the community," except running "git apply" on the patch complains:

ubercart-product-kit-ordering-1919376.patch:18: trailing whitespace.
  
warning: 1 line adds whitespace errors.

This is because you added a space at the end of line 242 in uc_product_kit.module. The following patch is the same as yours, but eliminates the space.

DanZ’s picture

Here's the patch.

Jordan_Fei’s picture

Hi DanZ,

Thanks! I eliminated the space and attach this patch again. Hope this patch will be applied to git soon.

Jordan

Status: Needs review » Needs work

The last submitted patch, ubercart-product-kit-ordering-1919376.patch, failed testing.

Jordan_Fei’s picture

Status: Needs work » Needs review
FileSize
1.55 KB

Hi system,

Sorry I patched the bug fixing based on and old revision, now re-patched it.

Thanks,
Jordan

longwave’s picture

Simpler patch that removes the need for a database query.

Jordan_Fei’s picture

hi longwave,

Thanks for reviewing and refining it simpler.

Jordan

longwave’s picture

@DanZ: can you test the patch in #9?

DanZ’s picture

Sorry, been out of town. I'll test it this weekend.

DanZ’s picture

Status: Needs review » Reviewed & tested by the community

I tested it, and it does indeed fix the bug. I set up a test kit with three test kit and messed with the order and subsequently edited the products. The sort order stayed where it was supposed to be. I didn't note any other problems in my test.

Thanks for you both for your work fixing this annoyance.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

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