UTA-FabLab / fabapp

Operational Software for any fablab or makerspace
Other
19 stars 21 forks source link

Wait_queue::printTicket Produces Ambiguous Query #65

Closed MPZinke closed 3 years ago

MPZinke commented 4 years ago

The Wait_queue::printTicket method's parameters can lead to ambiguous ticket selection, causing the first active ticket for a user to be selected. This causes issues when a user has multiple wait queue tickets, because the query does not select the correct one.

Proposal: Change public static function printTicket($operator, $dg_id) to public static function printTicket($Q_id) so that the passed ID references a primary key. Subsequent changes affect:

MPZinke commented 4 years ago

Priority assignment is deferred to Eric. Tentative fix is added to branch Bugfix-#65. It involve the above Proposal. Because this involves printing on the thermal printer, testing will occur on the Dev server.

MPZinke commented 4 years ago

Additionally, Wait_queue::insertQaitQueue() function did not properly handle $mysqli->insert_id. This caused the value to NULLify before use. This never showed up before, because the NULL zero was checked as being numeric, and was never used afterwards when returned. Issue fixed with d934001

FabosaurusRex commented 4 years ago

@MPZinke made updates on Saturday that resolve the issue, ready to merge into Dev.

FabosaurusRex commented 3 years ago

Fix has been rolled out to production. Closing issue.