Bug 33749 - Move Koha::MetadataRecord::stripWhitespaceChars into a RecordProcessor filter
Summary: Move Koha::MetadataRecord::stripWhitespaceChars into a RecordProcessor filter
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Aleisha Amohia
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on: 30358
Blocks:
  Show dependency treegraph
 
Reported: 2023-05-16 18:08 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2024-07-04 20:37 UTC (History)
4 users (show)

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


Attachments
Bug 33749: Add TrimFields field class (3.79 KB, patch)
2023-06-07 20:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 33749: Use TrimFields instead of stripWhitespaceChars (5.37 KB, patch)
2023-06-07 20:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 33749: Add TrimFields field class (3.84 KB, patch)
2023-09-30 21:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 33749: Use TrimFields instead of stripWhitespaceChars (5.41 KB, patch)
2023-09-30 21:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 33749: Add TrimFields field class (3.90 KB, patch)
2023-11-03 14:52 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33749: Add TrimFields field class (3.90 KB, patch)
2023-11-03 14:54 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33749: Use TrimFields instead of stripWhitespaceChars (5.47 KB, patch)
2023-11-03 14:54 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 33749: (QA follow-up) Tidy code for qa script (11.69 KB, patch)
2023-11-03 14:54 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

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