Bug 29375 - Excessive regular expressions for treating barcodes
Summary: Excessive regular expressions for treating barcodes
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Andrii Veremeienko
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-29 13:58 UTC by Andrii Veremeienko
Modified: 2021-10-31 10:35 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29375: Excessive regular expressions (2.56 KB, patch)
2021-10-30 11:40 UTC, Andrii Veremeienko
Details | Diff | Splinter Review

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