ulsdevteam / lcsu

0 stars 0 forks source link

Scanning book barcode to close a tray should error #46

Closed ctgraham closed 4 years ago

ctgraham commented 4 years ago

Scanned a book barcode after scanning counted books into a tray, then scanning the next book barcode directed to /trays/scan-init rather than presenting a error.

This also updated the tray barcode with the book barcode.

ctgraham commented 4 years ago

The tray barcode is also replaced with the book barcode in an error with the validation phase.

ctgraham commented 4 years ago

This line is far too trusting: https://github.com/ulsdevteam/lcsu/blob/957941ab851acc89c4fe9d4c75a3dd572d5b78ba/src/Controller/TraysController.php#L184 This same code is used in validation and in initial scan.

This line should simply validate, not push new data into the tray. https://github.com/ulsdevteam/lcsu/blob/957941ab851acc89c4fe9d4c75a3dd572d5b78ba/src/Template/Trays/scan_end.ctp#L13

ctgraham commented 4 years ago

This appears to be mostly resolved by https://github.com/ulsdevteam/lcsu/commit/75f732e07e8efd3a5a6f6b89d2d97407cdef2a74, pending a fix for: https://github.com/ulsdevteam/lcsu/commit/75f732e07e8efd3a5a6f6b89d2d97407cdef2a74#r35238489

wopsononock commented 4 years ago

book barcode yields an error message as expected.