I am using a shop/updatebasket/before trigger to test products for available inventory against the quantity requested in the cart. Upon failure, I set the workflow to STATUS_REDIRECT_REPEAT and redirect back to the cart. If you then put a new number into the quantity field and hit the update quantities button, the system was pulling the last value you entered (instead of the new value) and allowing it through.
For instance, if a product had inventory 10 and I tried to add 12 to my cart, it threw an error and put me back in the cart. Then I would change the requested value to 8 and re-submit, and it would put 12 items in my cart.
I tracked this down to two issues:
No memento keys are defined for the updatebasket function:
====== Bellow is tackled in #016648:
Having done this, the memento still wasn't properly keyed as the function for creating the keys does not handle arrays being passed as values.
I changed the "createKey" function to the following:
This fixed the issue.