Bug 41931 - While creating EasyAnalytics empty subfields are created
Summary: While creating EasyAnalytics empty subfields are created
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: 2026-02-25 14:12 UTC by Janusz Kaczmarek
Modified: 2026-02-28 08:27 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Sponsored
Comma delimited list of Sponsors: Ignatianum University in Cracow
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41931: While creating EasyAnalitics empty subfields are (often) created. (2.62 KB, patch)
2026-02-25 15:21 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 41931: Unit tests (2.29 KB, patch)
2026-02-25 15:21 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 41931: While creating EasyAnalitics empty subfields are (often) created. (2.67 KB, patch)
2026-02-25 16:39 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 41931: Unit tests (2.35 KB, patch)
2026-02-25 16:39 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2026-02-25 14:12:26 UTC
While creating EasyAnalitics empty subfields are (often) created. In C4::Biblio::PrepHostMarcField a whole set of subfields is addes to the field 773 regardless if a respective value exists or not. This often creates empty subfields and generates warnings. 

To reproduce:
1. Set EasyAnalyticalRecords to Show.
2. Go to biblio #1, copy the barcode.
3. Go to biblio #2, chose Edit > Link to host record > enter the barcode.
4. Examine the biblio #2: a) a new "virtual" item from biblio #1 is being displayed; b) a 773 field has been inserted, but with empty subfields $d & $x).
5. There should be warnings in plack-intranet-error.log like:
[WARN] Use of uninitialized value in join or string at /usr/share/perl5/MARC/Field.pm line 696.
Comment 1 Janusz Kaczmarek 2026-02-25 15:21:11 UTC
Created attachment 193858 [details] [review]
Bug 41931: While creating EasyAnalitics empty subfields are (often) created.

In C4::Biblio::PrepHostMarcField a whole set of subfields is addes to
the field 773 regardless if a respective value exists or not. This
often creates empty subfields and generates warnings.

Test plan:
==========
1. Set EasyAnalyticalRecords to Show.
2. Go to biblio #1, copy the barcode.
3. Go to biblio #2, chose Edit > Link to host record > enter the
   barcode.
4. Examine the biblio #2: a) a new "virtual" item from biblio #1 is
   being displayed; b) a 773 field has been inserted, but with empty
   subfields $d & $x.
5. There should be warnings in plack-intranet-error.log like:
[WARN] Use of uninitialized value in join or string at /usr/share/perl5/MARC/Field.pm line 696.
6. Apply the patch ; restart_all.
7. Go to biblio #3 (!), chose Edit > Link to host record > enter the
   barcode.
8. Examine the biblio #3: a) a new "virtual" item from biblio #1 is
   being displayed; b) a 773 field has been inserted, with no empty
   subfields.
9. No new warnings.

Sponsored-by: Ignatianum University in Cracow
Comment 2 Janusz Kaczmarek 2026-02-25 15:21:13 UTC
Created attachment 193859 [details] [review]
Bug 41931: Unit tests
Comment 3 Roman Dolny 2026-02-25 16:39:56 UTC
Created attachment 193916 [details] [review]
Bug 41931: While creating EasyAnalitics empty subfields are (often) created.

In C4::Biblio::PrepHostMarcField a whole set of subfields is addes to
the field 773 regardless if a respective value exists or not. This
often creates empty subfields and generates warnings.

Test plan:
==========
1. Set EasyAnalyticalRecords to Show.
2. Go to biblio #1, copy the barcode.
3. Go to biblio #2, chose Edit > Link to host record > enter the
   barcode.
4. Examine the biblio #2: a) a new "virtual" item from biblio #1 is
   being displayed; b) a 773 field has been inserted, but with empty
   subfields $d & $x.
5. There should be warnings in plack-intranet-error.log like:
[WARN] Use of uninitialized value in join or string at /usr/share/perl5/MARC/Field.pm line 696.
6. Apply the patch ; restart_all.
7. Go to biblio #3 (!), chose Edit > Link to host record > enter the
   barcode.
8. Examine the biblio #3: a) a new "virtual" item from biblio #1 is
   being displayed; b) a 773 field has been inserted, with no empty
   subfields.
9. No new warnings.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 4 Roman Dolny 2026-02-25 16:39:58 UTC
Created attachment 193917 [details] [review]
Bug 41931: Unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>