Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing

Due to changes made by the commit 0472b56a67, when editing an
existing bibliographic record a default value is inserted while it
should not, according to ApplyFrameworkDefaults systempreference.

Test plan:
==========
1. Verify that ApplyFrameworkDefaults systempreference is set to
   ‘when cataloguing new records only’.
2. Take any existing bibliographic record, e.g. sn:1. Open it in
   standard editor and identify a non used (empty) subfield, e.g. 024 $a.
   Note the framework (Books, Booklets, Workbooks). Close the editor
   (Cancel).
3. Modify the framework in question (Books, Booklets, Workbooks) by
   setting a default value for the chosen subfield (e.g. 024 $a).
4. Open the record in the editor again. Note that the 024 $a subfield
   has now an inserted default value while it should not, according to
   the ApplyFrameworkDefaults setting. Do not save the record, chose
   Cancel.
5. Apply the patch ; restart_all.
6. Repeat p. 4 -- there should be no default value inserted in the
   existing record now.

Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Janusz Kaczmarek 2025-03-26 17:33:37 +00:00 committed by Katrin Fischer
parent f7f5d8056a
commit cfe3421891
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ sub new {
my $self = {};
if ( exists $self->{biblionumber} ) {
if ( exists $params->{biblionumber} ) {
$self->{biblionumber} = $params->{biblionumber} =~ s/\D//gr;
# just in case biblionumber obtained from CGI and passed directly here contains weird characters like spaces