Issue description: After upgrading to commerce 7.x-1.0-beta4 when going to /cart you can change quantity without the validation stopping you from going over the stock limit
Patch description: Looks like the form name changed from to views_form_commerce_cart_form_default to commerce_line_item_views_form_commerce_cart_form_default.
also validation function wasent working was using $form['view']['#value'] updated it to use $form_state['line_items'].
hope this works for others
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | cart_form_validation-1216188-8.patch | 1.03 KB | BarisW |
| #4 | fix-cart-validation-for-beta4-1216188-4.patch | 2.75 KB | guy_schneerson |
| #2 | fix-cart-validation-for-beta4-1216188-2.patch | 2.86 KB | guy_schneerson |
| fix-cart-validation-for-beta4.patch | 2.64 KB | guy_schneerson |
Comments
Comment #1
guy_schneerson commentedhold that patch needs work - will put an update later today
Comment #2
guy_schneerson commentedupdated patch - tested and works nicely on my installation
Comment #3
guy_schneerson commentedi am updating and reviewing all my recent patches
Comment #4
guy_schneerson commentedupdated patch tested on commerce rc-1
Comment #5
guy_schneerson commentedcommited: c9578e7
Comment #6
guy_schneerson commentedcommited: c9578e7
Comment #8
BarisW commentedHere's a re-roll.
Comment #9
guy_schneerson commentedHi BarisW and thanks for the patch but can you please explain why you reopened the issue and what your patch does.
Comment #10
BarisW commentedIt's been a while, so I'm not sure why I added it. I believe that my error was the same as the OP, and that I found out that the array key didn't necessarily match the line item ID. This patch fixes that.
Comment #11
guy_schneerson commentedThanks @BarisW will test and look at the code.
Comment #13
guy_schneerson commentedWhile the last patch (#8) works, I can not see how the old code does not. As we are retrieving the info from the line items attached to the form, it looks to me safer to extract the ids from those line items and not the line items of the attached order.
I will live the code as is unless we can reproduces the bug.
If anyone comes across this issue please try the #8 patch and see if it resolves the issue