Koha-clms/Koha/Filter/MARC
Janusz Kaczmarek ba0f50fb01
Bug 40128: StripWhitespaceChars can create empty subfields
When StripWhitespaceChars is enabled and the user by chance enters
some white spaces in the input field, Koha generates empty subfield
(or even entirely empty field).

Test plan:
==========
1. Enable StripWhitespaceChars system preference.
2. Edit an existing record, putting just some spaces into an empty
   subfield. Save the record.
3. Go to bibliographic record Normal view and in modal "MARC preview"
   notice that the subfield you entered spaces in exists as an empty
   subfield. If it was the only subfield in a field, the field exists
   with no data at all. This is wrong.
4. Apply the patch ; restart_all.
5. Repeat 2. and 3. You should not see any empty subfield now. If the
   empty subbfield was the only subfield in a field, the field should
   have been removed from the record.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d0ce815600)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit f48cb7a0f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-07-31 16:18:10 +02:00
..
EmbedItems.pm Bug 32464: Koha::Item->as_marc_field obsolete option mss 2023-06-06 15:40:15 -03:00
EmbedItemsAvailability.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
EmbedSeeFromHeadings.pm Bug 34481: Tidy altered code 2024-06-27 14:04:50 +02:00
ExpandCodedFields.pm Bug 30848: Fix issue exposed by unit tests 2022-07-01 09:15:46 -03:00
Null.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
TrimFields.pm Bug 40128: StripWhitespaceChars can create empty subfields 2025-07-31 16:18:10 +02:00
ViewPolicy.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00