Bug 33749

Summary: Move Koha::MetadataRecord::stripWhitespaceChars into a RecordProcessor filter
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, kyle, martin.renvoize, tomascohen
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:
23.11.00
Circulation function:
Bug Depends on: 30358    
Bug Blocks:    
Attachments: Bug 33749: Add TrimFields field class
Bug 33749: Use TrimFields instead of stripWhitespaceChars
Bug 33749: Add TrimFields field class
Bug 33749: Use TrimFields instead of stripWhitespaceChars
Bug 33749: Add TrimFields field class
Bug 33749: Add TrimFields field class
Bug 33749: Use TrimFields instead of stripWhitespaceChars
Bug 33749: (QA follow-up) Tidy code for qa script

Description Tomás Cohen Arazi (tcohen) 2023-05-16 18:08:08 UTC
Bug 30358 introduced the static method Koha::MetadataRecord::stripWhitespaceChars. This method should've been put on a RecordProcessor filter. I open this bug for handling that.
Comment 1 Martin Renvoize (ashimema) 2023-06-07 12:02:35 UTC
100% agree here.
Comment 2 Tomás Cohen Arazi (tcohen) 2023-06-07 20:33:36 UTC
Created attachment 152135 [details] [review]
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
Comment 3 Tomás Cohen Arazi (tcohen) 2023-06-07 20:33:39 UTC
Created attachment 152136 [details] [review]
Bug 33749: Use TrimFields instead of stripWhitespaceChars

This patch replaces the uses of the static method with the new filter.
It also moves the tests to the relevant place and removes the (now)
unused method.
Comment 4 Tomás Cohen Arazi (tcohen) 2023-06-07 20:38:28 UTC
Can we get a review from the original authors?
Comment 5 David Nind 2023-09-30 21:36:52 UTC
Created attachment 156442 [details] [review]
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>
Comment 6 David Nind 2023-09-30 21:36:55 UTC
Created attachment 156443 [details] [review]
Bug 33749: Use TrimFields instead of stripWhitespaceChars

This patch replaces the uses of the static method with the new filter.
It also moves the tests to the relevant place and removes the (now)
unused method.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Kyle M Hall (khall) 2023-11-03 14:52:15 UTC
Created attachment 158338 [details] [review]
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>
Comment 8 Kyle M Hall (khall) 2023-11-03 14:54:44 UTC
Created attachment 158339 [details] [review]
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>
Comment 9 Kyle M Hall (khall) 2023-11-03 14:54:50 UTC
Created attachment 158340 [details] [review]
Bug 33749: Use TrimFields instead of stripWhitespaceChars

This patch replaces the uses of the static method with the new filter.
It also moves the tests to the relevant place and removes the (now)
unused method.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Kyle M Hall (khall) 2023-11-03 14:54:52 UTC
Created attachment 158341 [details] [review]
Bug 33749: (QA follow-up) Tidy code for qa script

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Tomás Cohen Arazi (tcohen) 2023-11-03 15:09:13 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 12 Fridolin Somers 2023-11-10 02:28:07 UTC
Enhancement not pushed to 23.05.x