Bug 31152

Summary: EasyAnalyticalRecords - trim leading whitespace from barcode when linking to host record
Product: Koha Reporter: David Nind <david>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30409
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Nind 2022-07-13 20:54:19 UTC
When adding analytical record relationships the easy way with the EasyAnalyticalRecords system preference enabled, any leading whitespace in the barcode is not trimmed.

To reproduce:
1. Enable the EasyAnalyticalRecord system preference - change to 'Show'.
2. Copy a barcode from any item, for example: 39999000000498
3. For any record with item, select Edit > Link to host record.
4. Enter item barcode:
   - paste the barcode into the input field
   - put spaces before the barcode
   - press 'Select'.
5. Note error message: "ERROR: Unable to get the item number from this barcode.".

Notes:
- Only leading whitespace causes the error, trailing whitespace does not cause the error.
- Recent bug 30409 did some work on consolidating barcode checking.