If a user changes the default quantity and then changes a attribute, uc_acc reverts automatically back to the default_qty.
Changing line 55 from the module from:
$form['qty']['#default_value'] = $product->default_qty
to:
// use qty from post or use default qty
$qty = intval($_POST['qty']);
if ($qty <> 0) {
$form['qty']['#default_value'] = $qty;
}
else {
$form['qty']['#default_value'] = $product->default_qty;
}
Helps uc_acc remembering.
Thanks for the great module!
(ps might make a patch later...)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | uc_aac-657052_2.patch | 2.88 KB | jantoine |
| #1 | uc_aac-657052.patch | 943 bytes | jantoine |
Comments
Comment #1
jantoine commentedSplash112,
Thanks for catching this bug and providing a fix. I have created a patch. It is slightly different. I did not want to alter the value in the qty box at all, so we'll just check to see if it has been set and if so, we'll use the value stored there.
Cheers
Antoine
Comment #2
splash112 commentedHi Antoine
Thanks for your quick reaction.
Looks ok to me, except it might pose a security risk. There is no way of knowing what's inside the post, could be anything (same btw for the nid). (ps. I'm not a security expert...)
Comment #3
jantoine commentedsplash112,
You're absolutely right, I should be checking all user input. Attached is a new patch that does just this. Let me know if you see any issues with this patch.
Cheers,
Antoine
Comment #4
jantoine commentedI have been using this code for a while without any issues. This patch has been committed to the repository.
Cheers,
Antoine