Bugzilla – Attachment 145309 Details for
Bug 30358
Strip leading/trailing whitespace characters from input fields when cataloguing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30358: (follow-up) Also strip inner newlines
Bug-30358-follow-up-Also-strip-inner-newlines.patch (text/plain), 5.48 KB, created by
Kyle M Hall (khall)
on 2023-01-13 20:00:56 UTC
(
hide
)
Description:
Bug 30358: (follow-up) Also strip inner newlines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-01-13 20:00:56 UTC
Size:
5.48 KB
patch
obsolete
>From 5ff823e7690af340d55a30890900e3fd69caa610 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 4 Apr 2022 02:34:55 +0000 >Subject: [PATCH] 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> >--- > C4/AuthoritiesMarc.pm | 2 +- > C4/Biblio.pm | 2 +- > .../bug_30358_-_add_StripWhitespaceChars_syspref.pl | 2 +- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 4e12c0c7b5..8bd49411bb 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -662,7 +662,7 @@ sub AddAuthority { > foreach my $subfield ( $field->subfields ) { > my $key = $subfield->[0]; > my $value = $subfield->[1]; >- $value =~ s/^\s+|\s+$|^\n+|\n+$|^\r+|\r+$|^\t+|\t+$//g; >+ $value =~ s/^\s+|\s+$|\n+|\r+|^\t+|\t+$//g; > $field->update( $key => $value ); > } > } >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index ab20d07566..a861e5a1b7 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2756,7 +2756,7 @@ sub ModBiblioMarc { > foreach my $subfield ( $field->subfields ) { > my $key = $subfield->[0]; > my $value = $subfield->[1]; >- $value =~ s/^\s+|\s+$|^\n+|\n+$|^\r+|\r+$|^\t+|\t+$//g; >+ $value =~ s/^\s+|\s+$|\n+|\r+|^\t+|\t+$//g; > $field->update( $key => $value ); > } > } >diff --git a/installer/data/mysql/atomicupdate/bug_30358_-_add_StripWhitespaceChars_syspref.pl b/installer/data/mysql/atomicupdate/bug_30358_-_add_StripWhitespaceChars_syspref.pl >index 80957d8145..1a6f0356e9 100644 >--- a/installer/data/mysql/atomicupdate/bug_30358_-_add_StripWhitespaceChars_syspref.pl >+++ b/installer/data/mysql/atomicupdate/bug_30358_-_add_StripWhitespaceChars_syspref.pl >@@ -7,6 +7,6 @@ return { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; > >- $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('StripWhitespaceChars', '0', NULL, 'Strip leading and trailing whitespace characters from input fields when cataloguing bibliographic and authority records.', 'YesNo') }); >+ $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('StripWhitespaceChars', '0', NULL, 'Strip leading and trailing whitespace characters and inner newlines from input fields when cataloguing bibliographic and authority records.', 'YesNo') }); > }, > }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 7870fdf9f7..2c08558ae4 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -690,7 +690,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('StatisticsFields','location|itype|ccode', NULL, 'Define Fields (from the items table) used for statistics members','Free'), > ('StockRotation','0',NULL,'If ON, enables the stock rotation module','YesNo'), > ('StoreLastBorrower','0','','If ON, the last borrower to return an item will be stored in items.last_returned_by','YesNo'), >-('StripWhitespaceChars','0',NULL,'Strip leading and trailing whitespace characters from input fields when cataloguing bibliographic and authority records.','YesNo'), >+('StripWhitespaceChars','0',NULL,'Strip leading and trailing whitespace characters and inner newlines from input fields when cataloguing bibliographic and authority records.','YesNo'), > ('SubfieldsToAllowForRestrictedBatchmod','','Define a list of subfields for which edition is authorized when items_batchmod_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j',NULL,'Free'), > ('SubfieldsToAllowForRestrictedEditing','','Define a list of subfields for which edition is authorized when edit_items_restricted permission is enabled, separated by spaces. Example: 995\$f 995\$h 995\$j',NULL,'Free'), > ('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index 36165b707a..6abfee9417 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -191,7 +191,7 @@ Cataloging: > choices: > 1: Strip > 0: "Don't strip" >- - leading and trailing whitespace characters from input fields when cataloguing bibliographic and authority records. Whitespace characters include spaces, tabs, newlines and carriage returns. >+ - leading and trailing whitespace characters (including spaces, tabs, line breaks and carriage returns) and inner newlines from input fields when cataloguing bibliographic and authority records. > Display: > - > - 'Separate main entry and subdivisions with ' >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30358
:
132202
|
132275
|
132919
|
133055
|
133056
|
133140
|
133224
|
133225
|
134195
|
134453
|
137451
|
137452
|
137453
|
137454
|
137455
|
137456
|
137457
|
139110
|
142905
|
142906
|
142907
|
142908
|
142909
|
142910
|
142911
|
142912
|
143053
|
143057
|
143058
|
143059
|
143060
|
143061
|
143062
|
143063
|
143064
|
143065
|
144120
|
144121
|
144122
|
144123
|
144124
|
144125
|
144126
|
144127
|
144128
|
144129
|
144130
|
144171
|
145308
|
145309
|
145310
|
145311
|
145312
|
145313
|
145314
|
145315
|
145316
|
145317
|
145318
|
151202
|
151203
|
151204
|
151205
|
151206
|
151207
|
151208
|
151210
|
151212
|
151214
|
151215