Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences
Aleisha Amohia 39b17d0526
Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing
This enhancement adds a system preference StripWhitespaceChars which,
when enabled, will strip leading and trailing whitespace characters from
all fields when cataloguing both bibliographic records and authority
records. Whitespace characters that will be stripped are:
- spaces
- newlines
- carriage returns
- tabs

To test:
1. Apply patch and install database updates
2. Go to Administration, system preferences, find the new
StripWhitespaceChars preference. It should be "Don't strip" by default.
Change it to "Strip".
3. Search for a biblio record and edit it. Put some leading or trailing
whitespace characters in input fields and textarea fields and save.
4. Confirm these characters are removed when you save the record.
5. Repeat steps 3 and 4 for authority records.
6. Confirm tests pass t/db_dependent/Biblio/ModBiblioMarc.t

Sponsored-by: Educational Services Australia SCIS

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Also strip inner newlines

This patch amends the StripWhitespaceChars system preference to also
strip inner newlines (line breaks and carriage returns) when enabled.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Inner newlines should be replaced with a space

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Fixing tests and including for inner newlines

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Clarify syspref wording about fields affected

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Consider field has multiple subfields of same key

To test:

1) Click the clone subfield button to make multiple subfields with the
same key, i.e. 500$a$a$a
2) Save the record and confirm that the fields contain the correct data
after whitespaces are stripped.

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Put multiple subfields fix on auth side

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) stripWhitespaceChars subroutine and tests

To test:

Confirm test plan above still works as expected and tests pass in
t/Koha_MetadataRecord.t

Sponsored-by: Catalyst IT

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Fixing ModBiblioMarc.t tests

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Do not strip whitespace from control fields

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 30358: (follow-up) Simplify regex

The regex does the following:
1. Replace newlines and carriage returns with a space
2. Replace leading and trailing whitespace with nothing (strip)

Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-16 15:17:26 -03:00
..
accounting.pref Bug 31730: (QA follow-up) Only link category name 2022-10-24 17:31:11 -03:00
acquisitions.pref Bug 8179: Receive multiple orders 2023-05-15 08:53:47 -03:00
admin.pref Bug 32355: Add css class url to URL syspref 2022-12-13 08:43:24 -03:00
authorities.pref Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
cataloguing.pref Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing 2023-05-16 15:17:26 -03:00
circulation.pref Bug 31557: Add ability for holds queue builder to prioritize either matching a patron's home library to the item's home or holding library 2023-05-12 11:22:47 -03:00
enhanced_content.pref Bug 32355: Add css class url to URL syspref 2022-12-13 08:43:24 -03:00
erm.pref Bug 32147: Capitalization: E-Resource management 2022-11-16 08:46:20 -03:00
i18n_l10n.pref Bug 31886: Fix no sidebar problem in system pref search 2022-10-24 10:37:31 -03:00
interlibrary_loans.pref Bug 32799: Rename ILLSTATUS authorised value category to ILL_STATUS_ALIAS 2023-02-27 13:08:10 -03:00
local_use.pref Bug 31952: (QA follow-up) Fix capitalization: Local Use 2022-10-27 09:36:44 -03:00
logs.pref Bug 32057: Add optional stack trace to action logs 2023-03-14 08:49:32 -03:00
opac.pref Bug 21330: (QA follow-up) Add 'empty' option to system preference description 2023-05-15 18:24:05 -03:00
patrons.pref Bug 33196: Generalize pseudonymization system preference description 2023-05-05 12:13:56 -03:00
searching.pref Bug 32355: Add css class url to URL syspref 2022-12-13 08:43:24 -03:00
serials.pref Bug 31886: Fix no sidebar problem in system pref search 2022-10-24 10:37:31 -03:00
staff_interface.pref Bug 21330: (follow-up) Fix new preference text and place 2023-05-15 18:24:04 -03:00
tools.pref
web_services.pref