To reproduce: Create a product like "Snickers Bar" or "Bottle of Water" as listed below.

screenshot

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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jbeuckm’s picture

Issue summary: View changes
jbeuckm’s picture

Issue summary: View changes
jbeuckm’s picture

Title: "Invalid Input" adding some products. » "Invalid Input" Adding SKU with Leading Zero
icylace’s picture

Status: Active » Needs review
FileSize
809 bytes

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

zeezhao’s picture

Thanks 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.

rbayliss’s picture

Yeah, 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.

mglaman’s picture

Updated patch per #6

kfitz’s picture

Patch addresses and corrects issue; tested on fresh install.

kfitz’s picture

Status: Needs review » Reviewed & tested by the community
kfitz’s picture

smccabe’s picture

Status: Reviewed & tested by the community » Fixed

  • smccabe committed 8259847 on 7.x-1.x authored by mglaman
    Issue #2301183 by mglaman, icylace: "Invalid Input" Adding SKU with...
smccabe’s picture

Status: Fixed » Closed (fixed)