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

Comments

guy_schneerson’s picture

hold that patch needs work - will put an update later today

guy_schneerson’s picture

updated patch - tested and works nicely on my installation

guy_schneerson’s picture

Assigned: Unassigned » guy_schneerson
Status: Active » Needs work

i am updating and reviewing all my recent patches

guy_schneerson’s picture

Assigned: guy_schneerson » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.75 KB

updated patch tested on commerce rc-1

guy_schneerson’s picture

commited: c9578e7

guy_schneerson’s picture

Status: Needs review » Fixed

commited: c9578e7

Status: Fixed » Closed (fixed)

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

BarisW’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
StatusFileSize
new1.03 KB

Here's a re-roll.

guy_schneerson’s picture

Hi BarisW and thanks for the patch but can you please explain why you reopened the issue and what your patch does.

BarisW’s picture

It'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.

guy_schneerson’s picture

Thanks @BarisW will test and look at the code.

guy_schneerson’s picture

Status: Needs review » Fixed

While 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

Status: Fixed » Closed (fixed)

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