Bug 17347

Summary: 'Renew' tab should ignore whitespace at begining and end of barcode
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: CirculationAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, gmcharlt, kohadevinim, kyle.m.hall, lucas, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 17347: Ignore whitespace before and after on renewing
Bug 17347: Ignore whitespace before and after on renewing
Bug 17347: Ignore whitespace before and after on renewing
Bug 17347: Ignore whitespace before and after on renewing

Description Katrin Fischer 2016-09-25 13:06:45 UTC
When you copy a barcode from somewhere else, sometimes there is whitespace at the beginning or the end. The checkout tab ignores this, the renew tab should as well. If you enter "   validbarcode" the barcode is not found at the moment.
Comment 1 Katrin Fischer 2019-01-14 20:47:42 UTC
Created attachment 83918 [details] [review]
Bug 17347: Ignore whitespace before and after on renewing

When an item is checked out, Koha ignores whitespace
at the beginning and the end of the entered barcode.
This makes life easier, if a barcode is C&P from another
page. This patch makes the renewal page behave the same.

To test:
- Checkout an item
- Renew the item from the renew tab or renewal page
  entering the barcode with leading and trailing
  whitespace
- "Barcode not found"
- Apply patch
- Try again
- Barcode should be found now
Comment 2 Owen Leonard 2019-01-15 16:14:23 UTC
Created attachment 83988 [details] [review]
Bug 17347: Ignore whitespace before and after on renewing

When an item is checked out, Koha ignores whitespace
at the beginning and the end of the entered barcode.
This makes life easier, if a barcode is C&P from another
page. This patch makes the renewal page behave the same.

To test:
- Checkout an item
- Renew the item from the renew tab or renewal page
  entering the barcode with leading and trailing
  whitespace
- "Barcode not found"
- Apply patch
- Try again
- Barcode should be found now

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Devinim 2019-01-17 19:23:37 UTC
Created attachment 84151 [details] [review]
Bug 17347: Ignore whitespace before and after on renewing

When an item is checked out, Koha ignores whitespace
at the beginning and the end of the entered barcode.
This makes life easier, if a barcode is C&P from another
page. This patch makes the renewal page behave the same.

To test:
- Checkout an item
- Renew the item from the renew tab or renewal page
  entering the barcode with leading and trailing
  whitespace
- "Barcode not found"
- Apply patch
- Try again
- Barcode should be found now

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Comment 4 Devinim 2019-01-17 19:25:46 UTC
Hi Katrin,
Good patch, Thanks.

We tried to give a blank in the box, then press Tab, go back to the box again and paste the barcode, in that case it did not recognize the barcode since there is a Tab.

Thanks
Devinim Koha Team
Comment 5 Katrin Fischer 2019-01-17 19:48:18 UTC
Hi Devinim, could you test the same in circ please? I used the same regex that is used there. I was aiming to make them behave the same.
Comment 6 Martin Renvoize 2019-02-08 16:41:07 UTC
Created attachment 84882 [details] [review]
Bug 17347: Ignore whitespace before and after on renewing

When an item is checked out, Koha ignores whitespace
at the beginning and the end of the entered barcode.
This makes life easier, if a barcode is C&P from another
page. This patch makes the renewal page behave the same.

To test:
- Checkout an item
- Renew the item from the renew tab or renewal page
  entering the barcode with leading and trailing
  whitespace
- "Barcode not found"
- Apply patch
- Try again
- Barcode should be found now

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-02-08 16:41:40 UTC
Another trivial but helpful patch which introduces no regressions..

Passing QA
Comment 8 Nick Clemens 2019-02-11 18:37:20 UTC
Awesome work all!

Pushed to master for 19.05
Comment 9 Martin Renvoize 2019-02-12 13:12:34 UTC
Pushed to 18.11.x for 18.11.03
Comment 10 Lucas Gass 2019-02-12 22:44:09 UTC
backported to 18.05.x for 18.05.09
Comment 11 Fridolin Somers 2019-02-15 07:09:18 UTC
Pushed to 17.11.x for 17.11.15