Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce: Create a product like "Snickers Bar" or "Bottle of Water" as listed below.
Open POS view and tap "Product" to see the table of available products. Tap "Add to Order". For "Snickers Bar" and "Bottle of Water" in my product list, the modal closes and I get the error message "Invalid input." For the other two products, the product is added to the order correctly.
This is probably because of a leading zero in the SKU.
Comment | File | Size | Author |
---|---|---|---|
#7 | invalid_input_adding-2301183-7.patch | 1.2 KB | mglaman |
#4 | invalid_input_adding-2301183-4.patch | 809 bytes | icylace |
Screen Shot 2014-07-10 at 2.35.23 PM.png | 32.33 KB | jbeuckm |
Comments
Comment #1
jbeuckm CreditAttribution: jbeuckm commentedComment #2
jbeuckm CreditAttribution: jbeuckm commentedComment #3
jbeuckm CreditAttribution: jbeuckm commentedComment #4
icylace CreditAttribution: icylace at Last Call Media commentedjQuery's
data()
will try to convert data attribute values into JavaScript values.attr()
won't try to do any conversion and is what we need to handle leading-zero SKUs correctly.Comment #5
zeezhao CreditAttribution: zeezhao commentedThanks for your patch. It works but appears to have adverse effect on product quantity. When you press product button on POS and change quantity before "Add to Order", quantity on POS always comes up as 1 after pressing "Add to order".
You may need to clear your cache to see that prior to patch this worked fine.
Comment #6
rbayliss CreditAttribution: rbayliss at Last Call Media commentedYeah, it's unfortunate we can't just use .data() for this, but I don't see any way but to go with .attr(). Need this patch rerolled to have the quantity change handler update the quantity using .attr() too.
Comment #7
mglamanUpdated patch per #6
Comment #8
kfitz CreditAttribution: kfitz at Acro Commerce commentedPatch addresses and corrects issue; tested on fresh install.
Comment #9
kfitz CreditAttribution: kfitz commentedComment #10
kfitz CreditAttribution: kfitz at Acro Commerce commentedComment #11
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedComment #13
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commented