Bug 17347 - 'Renew' tab should ignore whitespace at begining and end of barcode
Summary: 'Renew' tab should ignore whitespace at begining and end of barcode
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-25 13:06 UTC by Katrin Fischer
Modified: 2019-02-25 10:12 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17347: Ignore whitespace before and after on renewing (1.11 KB, patch)
2019-01-14 20:47 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17347: Ignore whitespace before and after on renewing (1.15 KB, patch)
2019-01-15 16:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17347: Ignore whitespace before and after on renewing (1.21 KB, patch)
2019-01-17 19:23 UTC, Devinim
Details | Diff | Splinter Review
Bug 17347: Ignore whitespace before and after on renewing (1.27 KB, patch)
2019-02-08 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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