Bug 23254

Summary: Batch item modification and deletion handle leading and trailing spaces inconsistently
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: BLOCKED --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23800
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Andrew Fuerste-Henry 2019-07-02 13:59:55 UTC
To Test:
- create an item with barcode "123 "
- enter barcode "123" in either batch item deletion or batch item modification
- receive a "barcode not found error for "123"
- note that your item with barcode "123 " does appear in the list for deletion/modification

similar to bug 22799 for case sensitivity in these tools.
Comment 1 Jonathan Druart 2019-11-21 11:53:57 UTC
Hi Andrew, The patch I attached on bug 23800 fixes this issue.
Comment 2 Jonathan Druart 2019-11-21 11:55:57 UTC
Marking as blocked until bug 23254 is resolved (and see if it fixes the issue from this bug report).
Comment 3 Jonathan Druart 2019-11-21 11:56:37 UTC
This is the confusing screen: https://snipboard.io/b6nxN8.jpg
Comment 4 Andrew Fuerste-Henry 2019-11-21 14:39:57 UTC
I just signed off bug 23800. While testing that, I also tested this.

I created items with the barcodes "123 " and " 123"
Without the patch for bug 23800, putting "123" in my list of barcode for batch item mod  found the item with barcode "123 " but gave an erroneous barcode not found error. It did not find " 123" at all.
With the patch and the same two barcodes in the system, I entered "123" into item batch mod and it didn't find anything. Then I entered " 123" and "123 " into item batch mod and they didn't find anything either.
So the patch from 23800 has changed this behavior, but doesn't seem to have fixed it.
Comment 5 Jonathan Druart 2019-11-21 14:50:59 UTC
(In reply to Andrew Fuerste-Henry from comment #4)
> I just signed off bug 23800. While testing that, I also tested this.
> 
> I created items with the barcodes "123 " and " 123"
> Without the patch for bug 23800, putting "123" in my list of barcode for
> batch item mod  found the item with barcode "123 " but gave an erroneous
> barcode not found error. It did not find " 123" at all.
> With the patch and the same two barcodes in the system, I entered "123" into
> item batch mod and it didn't find anything. Then I entered " 123" and "123 "
> into item batch mod and they didn't find anything either.
> So the patch from 23800 has changed this behavior, but doesn't seem to have
> fixed it.

Yes, and it cannot work, it is the expected behavior :)
But, since bug 22996 you can define the separator, so try to remove \s from the separator list and try again, it should work.