Bug 39462

Summary: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: CatalogingAssignee: Janusz Kaczmarek <januszop>
Status: Passed QA --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: major    
Priority: P5 - low CC: jonathan.druart, m.de.rooy, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 37870    
Bug Blocks:    
Attachments: Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing
Bug 39462: Unit tests
Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing
Bug 39462: Unit tests
Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing
Bug 39462: Unit tests

Description Janusz Kaczmarek 2025-03-26 17:32:23 UTC
Due to changes made by the commit 0472b56a671, when editing an existing bibliographic record a default value is inserted while it should not, according to ApplyFrameworkDefaults systempreference.
Comment 1 Janusz Kaczmarek 2025-03-26 17:41:20 UTC
Created attachment 179742 [details] [review]
Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing

Due to changes made by the commit 0472b56a671, 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)
Comment 2 Janusz Kaczmarek 2025-03-26 17:41:23 UTC
Created attachment 179743 [details] [review]
Bug 39462: Unit tests
Comment 3 Roman Dolny 2025-03-26 18:51:24 UTC
Created attachment 179744 [details] [review]
Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing

Due to changes made by the commit 0472b56a671, 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>
Comment 4 Roman Dolny 2025-03-26 18:51:26 UTC
Created attachment 179745 [details] [review]
Bug 39462: Unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 5 Martin Renvoize (ashimema) 2025-04-01 16:59:26 UTC
Created attachment 180226 [details] [review]
Bug 39462: (bug 37870 follow-up) Default values from framework are inserted into existing record while editing

Due to changes made by the commit 0472b56a671, 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>
Comment 6 Martin Renvoize (ashimema) 2025-04-01 16:59:29 UTC
Created attachment 180227 [details] [review]
Bug 39462: Unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>