Bug 40156 - Advanced editor should not create empty fields and subfields
Summary: Advanced editor should not create empty fields and subfields
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Janusz Kaczmarek
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-17 10:38 UTC by Janusz Kaczmarek
Modified: 2025-06-17 14:43 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40156: Advanced editor should not create empty fields and subfields (3.23 KB, patch)
2025-06-17 10:45 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 40156: Advanced editor should not create empty fields and subfields (3.30 KB, patch)
2025-06-17 14:41 UTC, Wojciech
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2025-06-17 10:38:50 UTC
Currently, advanced bibliographic records editor creates empty subfields (or even empty fields) when no content is placed after ‡<code> (or, in case of control fields, after <tag>).

To reproduce:
1. Enable EnableAdvancedCatalogingEditor.
2. Open a record in the advanced editor, create empty subfield and empty fields, i.e.:

007 
500 _ _ ‡a
246 3 1 ‡aAdditional title :‡b

3. Save the record. Go to bibliographic record Normal view and in modal "MARC preview" notice that the fields / subfields you entered as empty exist in the record with no data. This is wrong.
Comment 1 Janusz Kaczmarek 2025-06-17 10:45:57 UTC
Created attachment 183301 [details] [review]
Bug 40156: Advanced editor should not create empty fields and subfields

Currently, advanced bibliographic records editor creates empty
subfields (or even empty fields) when no content is placed after
‡<code> (or, in case of control fields, after <tag>).

Test plan:
==========
1. Enable EnableAdvancedCatalogingEditor (have StripWhitespaceChars
   set to "Don't strip" - the default setting).
2. Open a record in the advanced editor, create empty subfield and
   empty fields, e.g.:

007
500 _ _ ‡a
246 3 1 ‡aAdditional title :‡b

3. Save the record. Go to bibliographic record Normal view and in
   modal "MARC preview" notice that the fields / subfields you entered as
   empty exist in the record with no data. This is wrong.
4. Apply the patch ; restart_all.
5. Repeat p. 2 and 3. Note that empty fields/subfields have not been
   created.

Sponsored-by: Ignatianum University in Cracow
Comment 2 Wojciech 2025-06-17 14:41:16 UTC
Created attachment 183309 [details] [review]
Bug 40156: Advanced editor should not create empty fields and subfields

Currently, advanced bibliographic records editor creates empty
subfields (or even empty fields) when no content is placed after
‡<code> (or, in case of control fields, after <tag>).

Test plan:
==========
1. Enable EnableAdvancedCatalogingEditor (have StripWhitespaceChars
   set to "Don't strip" - the default setting).
2. Open a record in the advanced editor, create empty subfield and
   empty fields, e.g.:

007
500 _ _ ‡a
246 3 1 ‡aAdditional title :‡b

3. Save the record. Go to bibliographic record Normal view and in
   modal "MARC preview" notice that the fields / subfields you entered as
   empty exist in the record with no data. This is wrong.
4. Apply the patch ; restart_all.
5. Repeat p. 2 and 3. Note that empty fields/subfields have not been
   created.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Wojciech Baran <wojciech.baran@ignatianum.edu.pl>