Bug 9268

Summary: Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly
Product: Koha Reporter: Liz Rea <liz>
Component: AcquisitionsAssignee: Liz Rea <liz>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: trivial    
Priority: P5 - low CC: chris, jonathan.druart
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 9507    
Attachments: Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly
Bug 9268 - Followup - Making it work properly in chrome as well
Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly
Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly
[SIGNED-OFF] Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly
Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly

Description Liz Rea 2012-12-11 21:10:00 UTC
Scanning in a barcode or an ISBN number in Acquisitions -> new order submits the form unexpectedly if the scanner sends carriage returns. If the carriage return is sent early, an error message is popped, which can be ignored but it's an extra click and it can be confusing to users. 

To replicate: 

* Go to Acquisitions - Manage Orders
* Search for a vendor 
* Click New Basket. 
* Fill required fields
* Press Save. 
* Click on "From a new (empty) record" 
* Type in title Private Oz, Author Patterson, James. 
* Scan (or type) ISBN - 9781864711875.
* (If not scanning, PRESS ENTER HERE) 
* A box pops up saying 'Form not submitted because of the following problem(s) - you must select budget - Quantity must be greater than '0'.
Comment 1 Jared Camins-Esakov 2012-12-11 21:16:38 UTC
I believe this has been fixed under Firefox but not under Chrome, which propagates the event up through the hierarchy of forms on that page. See bug 8557.
Comment 2 Liz Rea 2012-12-11 21:18:39 UTC Comment hidden (obsolete)
Comment 3 Liz Rea 2012-12-12 00:28:59 UTC Comment hidden (obsolete)
Comment 4 Liz Rea 2012-12-12 00:30:53 UTC
I should add - I haven't quite figured out how to make it work on the barcode entry field (yet) but at least the ISBN box won't cause the problem in chrome anymore.
Comment 5 Liz Rea 2012-12-12 01:56:45 UTC Comment hidden (obsolete)
Comment 6 Liz Rea 2012-12-12 01:57:20 UTC
Never mind! I found a better way to make it work so it works everywhere.
Comment 7 Liz Rea 2012-12-12 22:32:00 UTC
Sponsored by: Hauraki District Libraries, New Zealand
Comment 8 Liz Rea 2012-12-13 00:59:15 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2012-12-29 09:34:25 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2013-01-30 14:12:11 UTC
QA comment:

This patch works as expected.
It would be great to factorize this code (it appears in 3 tt files).

Marked as Passed QA.
Comment 11 Jonathan Druart 2013-01-30 14:12:47 UTC
Created attachment 14946 [details] [review]
Bug 9268 - Scanning in barcode or ISBN in Acquisitions -> new order submits the form unexpectedly

To Test:

* Go to Acquisitions - Manage Orders
* Search for a vendor
* Click New Basket.
* Fill required fields
* Press Save.
* Click on "From a new (empty) record"
* Type in title Private Oz, Author Patterson, James.
* Scan (or type) ISBN - 9781864711875.
* (If not scanning, PRESS ENTER HERE)
* Nothing should happen. Form should not be submitted, no error message should appear.

Sponsored by: Hauraki District Libraries, New Zealand

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested according to test plan in Firefox and Chromium on Ubuntu.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 12 Jared Camins-Esakov 2013-01-31 16:39:30 UTC
This patch has been pushed to master.
Comment 13 Chris Cormack 2013-02-03 03:01:54 UTC
Pushed to 3.10.x and 3.8.x will be in 3.10.3 and 3.8.10