Bug 9139

Summary: Sending empty vendor or biblio when adding subscriptions gives wrong error
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: andreas.hedstrom.mace, chris, colin.campbell, jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/serials/subscription-add.pl
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 9139: New subscription form - Does not check form on the first page
Bug 9139: New subscription form - Does not check form on the first page
Bug 9139: New subscription form - Does not check form on the first page
Bug 9139: New subscription form - Does not check form on the first page
[PASSED QA] Bug 9139: New subscription form - Does not check form on the first page

Description Katrin Fischer 2012-11-25 22:20:53 UTC
I can only reproduce this in Firefox, not in Chromium.

To reproduce:
- Add a new subscription
- Put cursor in first field for 'Vendor' or 'Biblio' and hit enter
- Perl error page is shown:

No record at /home/katrin/kohaclone/C4/Serials.pm line 1382

Sending an empty field should open the search pop up and not give a perl error message.
Comment 1 Katrin Fischer 2014-03-26 23:09:38 UTC
The message is now: You must choose a first publication date. This doesn't make much sense as the field is on the second page of the form and can't be accessed without filling out other mandatory fields first.
Comment 2 Jonathan Druart 2015-04-08 14:25:41 UTC Comment hidden (obsolete)
Comment 3 Andreas Hedström Mace 2015-04-13 19:35:50 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-04-17 06:21:18 UTC
I really like that you have the right search now open on pressing enter, but I think the possibility to enter the vendor number or record number directly is kind of a feature, so we should not remove that.
Comment 5 Jonathan Druart 2015-04-17 12:35:32 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-04-17 12:36:12 UTC
The preventDefault was bad placed.
Comment 7 Andreas Hedström Mace 2015-04-17 12:59:43 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2015-04-17 14:07:17 UTC
Created attachment 38071 [details] [review]
[PASSED QA] Bug 9139: New subscription form - Does not check form on the first page

The vendor and Record input try to sent the form if the focus is on the
inputs (normal behavior).
But the form is on 2 pages, and the popup message ask you to fill info
on the second page when you are on the first one. This does not make
sense.

This patch suggests to launch search when the enter key is press on
these inputs.

Test plan:
1/ Create a new subscription
2/ Put the focus in the Vendor input and press enter: the vendor search
popup should appear
3/ Put the focus in the Record input and press enter: the record search
popup should appear

Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 9 Tomás Cohen Arazi 2015-05-14 14:56:10 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 10 Chris Cormack 2015-05-17 22:56:12 UTC
Pushed to 3.18.x will be in 3.18.7