Summary: | Replace use of input type number in additem.js | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | david, fridolin.somers, jonathan.druart, martin.renvoize, nick, severine.queune, testopia |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
URL: | https://wiki.koha-community.org/wiki/Coding_Guidelines#ACC2:_Input_type_.22number.22_should_be_avoided | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28283 | ||
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: | |||
Bug Depends on: | |||
Bug Blocks: | 26926 | ||
Attachments: |
Bug 28135: Replace use of input type number in additem.js
Bug 28135: Replace use of input type number in additem.js Bug 28135: Replace use of input type number in additem.js |
Description
Owen Leonard
2021-04-12 11:24:02 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. 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 ? 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> This one seems to work for me.. what browser were you using to test Severine? (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' (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 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> (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 Pushed to master for 21.05, thanks to everybody involved! Not pushed to 20.11.x |