mariposacoop/IS4C — Issue #143: Issue with entering UPCs for weighable items
Author: tmmagee
Created: 2011-10-28 20:18:42+00:00
State: open

To reproduce:

1) Make sure nothing is on the scale
2) Enter or scan in UPC for a weighable item

A parser error occurs. The problems:

1) In function upcscanned in UPC.php: $ret['udpmsg'] was being returned without a valid value. Should be set to false
2) In function upcscanned in UPC.php: $ret['retry'] is set to the UPC that is entered. This value is a string. HOWEVER, when a call to array_to_json eventually occurs, this value is interpreted as a number, which leads to a json parser error. Solution: put quotes around the value to make sure it is interpreted as a string, and in array_to_json trim the quotes off before encoding it as a string.