Bug 33749: Add TrimFields field class
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 7 Jun 2023 17:28:34 +0000 (14:28 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 3 Nov 2023 15:08:06 +0000 (12:08 -0300)
commit54477ecc51e4504fa66d0f0cc6da50029225131a
tree96ac1ad18360dabff68daec2f91c7efa44f23696
parentb2c48b3e01a451452020143cb9e44d3a1b28646b
Bug 33749: Add TrimFields field class

This patch adds a RecordProcessor filter class that takes care of
performing the field cleanup that was originally done in the static
method `Koha::MetadataRecord::stripWhitespaceChars`.

In order to test the results, I adapted the tests to use the filter
instead of the original method.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/Koha_MetadataRecord.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Filter/MARC/TrimFields.pm [new file with mode: 0644]
t/Koha_MetadataRecord.t