Bug 9139 - Sending empty vendor or biblio when adding subscriptions gives wrong error
Summary: Sending empty vendor or biblio when adding subscriptions gives wrong error
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL: /cgi-bin/koha/serials/subscription-ad...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-25 22:20 UTC by Katrin Fischer
Modified: 2015-12-03 22:02 UTC (History)
5 users (show)

See Also:
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 (2.85 KB, patch)
2015-04-08 14:25 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9139: New subscription form - Does not check form on the first page (3.01 KB, patch)
2015-04-13 19:35 UTC, Andreas Hedström Mace
Details | Diff | Splinter Review
Bug 9139: New subscription form - Does not check form on the first page (2.86 KB, patch)
2015-04-17 12:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9139: New subscription form - Does not check form on the first page (3.02 KB, patch)
2015-04-17 12:59 UTC, Andreas Hedström Mace
Details | Diff | Splinter Review
[PASSED QA] Bug 9139: New subscription form - Does not check form on the first page (3.09 KB, patch)
2015-04-17 14:07 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 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