Bug 28135 - Replace use of input type number in additem.js
Summary: Replace use of input type number in additem.js
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL: https://wiki.koha-community.org/wiki/...
Keywords:
Depends on:
Blocks: 26926
  Show dependency treegraph
 
Reported: 2021-04-12 11:24 UTC by Owen Leonard
Modified: 2021-12-13 21:12 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 28135: Replace use of input type number in additem.js (2.39 KB, patch)
2021-04-12 11:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28135: Replace use of input type number in additem.js (2.46 KB, patch)
2021-05-04 10:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28135: Replace use of input type number in additem.js (2.51 KB, patch)
2021-05-10 10:01 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-04-12 11:24:02 UTC
Inputs of type="number" need updating to adhere to ACC2 in additem.js
Comment 1 Owen Leonard 2021-04-12 11:30:35 UTC
Created attachment 119450 [details] [review]
Bug 28135: Replace use of input type number in additem.js

This patch corrects in instance where JavaScript is creating an input
tag with type "number."

To test, apply the patch and make sure the AcqCreateItem system
preference is set to "when receiving."

- Go to Acquisitions -> Vendor -> Invoices -> Invoice -> Go to receipt
  page -> Receive.
- On the page for receiving items you should see an add item form.
- Click the "Add multiple items" button at the bottom of the form.
- Test the "Number of items to add" field. It should not accept any
  input except numbers.
Comment 2 Séverine Queune 2021-04-14 08:19:24 UTC
Hi Owen,
The field accepts number with decimal (point or comma), even though only the number before separator is taken into account for the items creation.
Is that expected ?
Comment 3 Martin Renvoize (ashimema) 2021-05-04 10:35:59 UTC
Created attachment 120434 [details] [review]
Bug 28135: Replace use of input type number in additem.js

This patch corrects in instance where JavaScript is creating an input
tag with type "number."

To test, apply the patch and make sure the AcqCreateItem system
preference is set to "when receiving."

- Go to Acquisitions -> Vendor -> Invoices -> Invoice -> Go to receipt
  page -> Receive.
- On the page for receiving items you should see an add item form.
- Click the "Add multiple items" button at the bottom of the form.
- Test the "Number of items to add" field. It should not accept any
  input except numbers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2021-05-04 10:36:45 UTC
This one seems to work for me.. what browser were you using to test Severine?
Comment 5 Nick Clemens (kidclamp) 2021-05-07 18:21:30 UTC
(In reply to Martin Renvoize from comment #4)
> This one seems to work for me.. what browser were you using to test Severine?

I get a similar problem to Severine on Firefox - I ordered 13 copies, put 3.4 into the quantity to receive.

When I typed 3 it selected three items, when I put '.4' it deselected all, but let me proceed. The quantity field in the order is correct at 10, but the quantity in the received order is 'NULL'
Comment 6 Jonathan Druart 2021-05-10 07:46:27 UTC
(In reply to Nick Clemens from comment #5)
> (In reply to Martin Renvoize from comment #4)
> > This one seems to work for me.. what browser were you using to test Severine?
> 
> I get a similar problem to Severine on Firefox - I ordered 13 copies, put
> 3.4 into the quantity to receive.
> 
> When I typed 3 it selected three items, when I put '.4' it deselected all,
> but let me proceed. The quantity field in the order is correct at 10, but
> the quantity in the received order is 'NULL'

Nick, was this comment for bug 28283?

I am not able to recreate what you describe on FF 78.8 ESR
Comment 7 Nick Clemens (kidclamp) 2021-05-10 10:01:11 UTC
Created attachment 120761 [details] [review]
Bug 28135: Replace use of input type number in additem.js

This patch corrects in instance where JavaScript is creating an input
tag with type "number."

To test, apply the patch and make sure the AcqCreateItem system
preference is set to "when receiving."

- Go to Acquisitions -> Vendor -> Invoices -> Invoice -> Go to receipt
  page -> Receive.
- On the page for receiving items you should see an add item form.
- Click the "Add multiple items" button at the bottom of the form.
- Test the "Number of items to add" field. It should not accept any
  input except numbers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens (kidclamp) 2021-05-10 10:05:12 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Nick Clemens from comment #5)
> > (In reply to Martin Renvoize from comment #4)
> > > This one seems to work for me.. what browser were you using to test Severine?
> > 
> > I get a similar problem to Severine on Firefox - I ordered 13 copies, put
> > 3.4 into the quantity to receive.
> > 
> > When I typed 3 it selected three items, when I put '.4' it deselected all,
> > but let me proceed. The quantity field in the order is correct at 10, but
> > the quantity in the received order is 'NULL'
> 
> Nick, was this comment for bug 28283?
> 
> I am not able to recreate what you describe on FF 78.8 ESR

Yes, I tested the wrong thing.


Note: There is no feedback when the input is incorrect - and I can still input strings as long as they start with a number, e.g. "4A" "5.2" but only the first numeric portion is used
Comment 9 Jonathan Druart 2021-05-11 13:39:31 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 10 Fridolin Somers 2021-05-12 15:20:25 UTC
Not pushed to 20.11.x