Bug 8557 - in orderreceive.tt and serials-edit.tt the use of a barcode scan send the form unexpectedly
Summary: in orderreceive.tt and serials-edit.tt the use of a barcode scan send the for...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P3 normal (vote)
Assignee: Christophe Croullebois
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-02 09:28 UTC by Christophe Croullebois
Modified: 2014-05-26 21:04 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
proposed patch (2.46 KB, patch)
2012-09-20 13:47 UTC, Christophe Croullebois
Details | Diff | Splinter Review
proposed patch (2.13 KB, patch)
2012-09-20 14:13 UTC, Christophe Croullebois
Details | Diff | Splinter Review
Bug-8557-Prevents-form-validation-by-pressing-Enter.patch (2.43 KB, patch)
2012-10-04 17:00 UTC, Frédéric Demians
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8557: Prevents form validation by pressing "Enter" (2.66 KB, patch)
2012-10-05 13:05 UTC, Marc Véron
Details | Diff | Splinter Review
pic (78.71 KB, image/png)
2012-11-01 07:38 UTC, Mason James
Details
snapshot without patch (95.01 KB, image/png)
2012-11-05 09:42 UTC, Christophe Croullebois
Details
[SIGNED-OFF] Bug 8557: Prevents form validation by pressing "Enter" (2.78 KB, patch)
2012-11-25 21:15 UTC, Katrin Fischer
Details | Diff | Splinter Review
Screenshot unwanted return while adding item during receiving process (136.93 KB, image/jpeg)
2012-11-28 23:07 UTC, Marc Véron
Details
[SIGNED-OFF] Bug 8641 [Follow up]-Reword warning about log-in as root user to About-System information (1.98 KB, patch)
2012-11-28 23:19 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 8557 - Unexpected behavior with scanners (4.17 KB, patch)
2012-12-12 02:13 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 8557 - Unexpected behavior with scanners (4.26 KB, patch)
2012-12-29 08:55 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 8557 - Unexpected behavior with scanners (4.56 KB, patch)
2013-01-14 07:35 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Croullebois 2012-08-02 09:28:34 UTC
in orderreceive when you receive an order with 'AcqCreateItem ' on 'receiving', you must first fill the 'Item' block and validating by clicking 'add' before clicking the 'save' button.
Using a scan machine is like typing 'enter' and saving this receive, it is unwanted.
For serials-edit it's the same problem.
So this patch do the same in the two pages.
To test:
You must have a barcode scan... ;o)
Or try to type enter without the patch, it's what the scan machine sends.
thx
Comment 1 Christophe Croullebois 2012-09-20 13:47:40 UTC Comment hidden (obsolete)
Comment 2 Christophe Croullebois 2012-09-20 14:13:17 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2012-10-03 15:19:37 UTC
I can confirm the behaviour without patch. 

However the patch does not longer apply:

error: patch failed: koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt:422
error: koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt: patch does not apply

Marc
Comment 4 Frédéric Demians 2012-10-04 17:00:41 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2012-10-05 13:05:30 UTC Comment hidden (obsolete)
Comment 6 Mason James 2012-11-01 07:38:27 UTC
Created attachment 13167 [details]
pic
Comment 7 Mason James 2012-11-01 07:40:04 UTC
(In reply to comment #0)
> in orderreceive when you receive an order with 'AcqCreateItem ' on
> 'receiving', you must first fill the 'Item' block and validating by clicking
> 'add' before clicking the 'save' button.
> Using a scan machine is like typing 'enter' and saving this receive, it is
> unwanted.
> For serials-edit it's the same problem.
> So this patch do the same in the two pages.
> To test:
> You must have a barcode scan... ;o)
> Or try to type enter without the patch, it's what the scan machine sends.


hmmm, i need more info to QA this patch...

do i need to scan a barcode in the 'barcode' field to test this patch?

if i do this, the 'enter' key *is* detected and the form is saved, 
so the patch does not seem to work (in chrome-osx)?


i have added a screenshot to explain what i am testing (the barcode field)
Comment 8 Christophe Croullebois 2012-11-05 09:42:39 UTC
Created attachment 13247 [details]
snapshot without patch

Hello James,
in fact, I have pasted a snapshot.
Without the patch if you hit "enter" in the orderreceive page, the form is submited, in my case I have not filled a requested field in order to make this state more visible.
So, James, you don't need a scan machine, the machine sends a "enter" to koha.
Without the patch if you hit enter (the same action than a scan) the form is submitted, what we need is that the scanning doesn't send the form.
With the patch if you hit "enter" nothing happens, it's what we expect.
Thx
Comment 9 Katrin Fischer 2012-11-25 21:15:50 UTC Comment hidden (obsolete)
Comment 10 Jared Camins-Esakov 2012-11-25 23:27:38 UTC
Could someone please confirm that there is no situation where a library would want Enter to automatically save the barcode? If that is a feature that libraries might be using, I am loth to remove it entirely.
Comment 11 Katrin Fischer 2012-11-26 05:54:27 UTC
I think it's consistent with other item forms (cataloguing) this way and is more like the expected behaviour.
Comment 12 Marc Véron 2012-11-27 09:16:43 UTC
I agree with Katrin.
Comment 13 Katrin Fischer 2012-11-27 09:20:09 UTC
I was thinking about this. Maybe a good rule of thumb could be: if the barcode field is one of many fields (data entry) we don't want it to submit the form, but when it's only a barcode field we want it to.
Would that make sense?
Comment 14 Marc Véron 2012-11-27 10:24:42 UTC
Makes sense!
Comment 15 Jared Camins-Esakov 2012-11-28 22:23:05 UTC
I do not see any "Add" button nor anywhere to edit items on the order receive page on current master. I see a table with a list of items, and there are links to take me to edit the items, but hitting enter in the barcode field on those screens does not do anything. Please provide a detailed test plan covering the entire workflow I should be following, starting at the VERY beginning, so that I can test this.
Comment 16 Marc Véron 2012-11-28 23:07:59 UTC
Created attachment 13749 [details]
Screenshot unwanted return while adding item during receiving process

1) 
Set syspref 'AcqCreateItem' to 'Create Item when receiving an order.'

2)
Create a basket for a vendor, add an order line.

3)
Search for this vendor using Vendor search

4)
Receive Shipment for this vendor and choose the title you ordered in 2)

5) You will get the dialog to create related item(s)

6)
Fill in Item 0 through o (see screenshot)

7)
Scan Barcode for field p - Barcode

7)
Result: Scanner sends a [return], form closes and you had no chance to fill in fields t - z
Comment 17 Marc Véron 2012-11-28 23:19:43 UTC Comment hidden (obsolete)
Comment 18 Marc Véron 2012-11-28 23:20:42 UTC
Comment on attachment 13750 [details] [review]
[SIGNED-OFF] Bug 8641 [Follow up]-Reword warning about log-in as root user to About-System information

Sorry, mistaked with bug number...
Comment 19 Jared Camins-Esakov 2012-11-28 23:38:41 UTC
This patch has been pushed to master. Marc, thank you for the detailed test plan.
As a note, I observe that this still does not work quite right in Chrome
Comment 20 Jared Camins-Esakov 2012-11-28 23:39:35 UTC
(In reply to comment #19)
> This patch has been pushed to master. Marc, thank you for the detailed test
> plan.
> As a note, I observe that this still does not work quite right in Chrome

... which is submitting a different form when you hit the "Enter" key. It works perfectly in FF, though.
Comment 21 Chris Cormack 2012-11-29 07:43:55 UTC
Pushed to 3.10.x, will be in 3.10.1
Comment 22 Liz Rea 2012-12-12 02:13:20 UTC Comment hidden (obsolete)
Comment 23 Marc Véron 2012-12-29 08:55:12 UTC Comment hidden (obsolete)
Comment 24 Katrin Fischer 2013-01-14 07:35:00 UTC
Created attachment 14556 [details] [review]
[SIGNED-OFF] Bug 8557 - Unexpected behavior with scanners

This is an alternative to the original implementation - this one works in chrome as well as firefox.

To test:

1)
Set syspref 'AcqCreateItem' to 'Create Item when receiving an order.'

2)
Create a basket for a vendor, add an order line.

3)
Search for this vendor using Vendor search

4)
Receive Shipment for this vendor and choose the title you ordered in 2)

5) You will get the dialog to create related item(s)

6)
Fill in Item 0 through o (see screenshot)

7)
Scan Barcode for field p - Barcode

7)
Result: Scanner sends a [return], form closes and you had no chance to fill in fields t - z

Signed-off-by: Marc Veron <veron@veron.ch>

Tested with Chrome Version 23.0.1271.97 m  and Firefox 17.0.1, both behave as expected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with Firefox and Chromium in Ubuntu.

Additional test done:
1) Add a new subscription, choose 'receive adds items'
2) Receive an issue, fill out $p with a barcode
3) Make sure hitting enter in the barcode field does not send the form.

All tests pass and QA script pass.
Comment 25 Jared Camins-Esakov 2013-01-15 04:08:23 UTC
This patch has been pushed to master.
Comment 26 Chris Cormack 2013-01-15 04:59:55 UTC
Pushed to 3.10.x will be in 3.10.2