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.

Files: 
CommentFileSizeAuthor
#9 1919376-product-kit-ordering-9.patch1.05 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 2,839 pass(es).
[ View ]
#8 ubercart-product-kit-ordering-1919376-8.patch1.55 KBJordan_Fei
PASSED: [[SimpleTest]]: [MySQL] 2,835 pass(es).
[ View ]
#6 ubercart-product-kit-ordering-1919376.patch1.55 KBJordan_Fei
FAILED: [[SimpleTest]]: [MySQL] 2,507 pass(es), 1 fail(s), and 0 exception(s).
[ View ]
#5 ubercart-product-kit-ordering-1919376-5.patch1.18 KBDanZ
PASSED: [[SimpleTest]]: [MySQL] 2,835 pass(es).
[ View ]
#3 ubercart-product-kit-ordering-1919376.patch1.56 KBJordan_Fei
PASSED: [[SimpleTest]]: [MySQL] 2,833 pass(es).
[ View ]

Comments

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

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.

Status:Active» Needs review
StatusFileSize
new1.56 KB
PASSED: [[SimpleTest]]: [MySQL] 2,833 pass(es).
[ View ]

hi DanZ,

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

Regards,
Jordan

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.

StatusFileSize
new1.18 KB
PASSED: [[SimpleTest]]: [MySQL] 2,835 pass(es).
[ View ]

Here's the patch.

StatusFileSize
new1.55 KB
FAILED: [[SimpleTest]]: [MySQL] 2,507 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

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.

Status:Needs work» Needs review
StatusFileSize
new1.55 KB
PASSED: [[SimpleTest]]: [MySQL] 2,835 pass(es).
[ View ]

Hi system,

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

Thanks,
Jordan

StatusFileSize
new1.05 KB
PASSED: [[SimpleTest]]: [MySQL] 2,839 pass(es).
[ View ]

Simpler patch that removes the need for a database query.

hi longwave,

Thanks for reviewing and refining it simpler.

Jordan

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

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

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.

Status:Reviewed & tested by the community» Fixed

Committed.

Status:Fixed» Closed (fixed)

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