Bug 29375

Summary: Excessive regular expressions for treating barcodes
Product: Koha Reporter: Andrii Veremeienko <andriiverem>
Component: ListsAssignee: Andrii Veremeienko <andriiverem>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: joonas.kylmala, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 29375: Excessive regular expressions

Description Andrii Veremeienko 2021-10-29 13:58:59 UTC
There are several places throughout the application where regular expressions are used for the whitespaces trimming together with the normalization function C4::Circulation::barcodedecode.

It is an overkilling and better to remove those regular expressions, because C4::Circulation::barcodedecode trimming whitespaces by itself.
Comment 1 Andrii Veremeienko 2021-10-30 11:40:33 UTC
Created attachment 127107 [details] [review]
Bug 29375: Excessive regular expressions

There are several places throughout the application where regular expressions are used for the whitespaces trimming together with the normalization function C4::Circulation::barcodedecode.

Solution was to remove those regular expressions, because C4::Circulation::barcodedecode trimming whitespaces by itself.

How to test:
1. Go to the Koha code base;
2. Do global search by "barcodedecode" key word;
3. Observe that there are several places where barcodedecode used with regular expression together;
4. Apply the patch;
5. Repeat steps 1, 2;
6. Observe that there are no regular expressions used together with barcodedecode;
Comment 2 Joonas Kylmälä 2021-10-31 10:35:47 UTC
Depending on the itemBarcodeInputFilter setting it doesn't do that. This would basically revert the fixes made in bug 25341.