Bug 32509

Summary: Embed see-also-from headings into bibliographic records export
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: Command-line UtilitiesAssignee: Fridolin Somers <fridolin.somers>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, robin
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34481
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Adds a new option, `--embed_see_also_from_headings`, to the `misc/export_records.pl` script. This will include any authority record see-also-from headings in the export for any bibliographic record 6xx fields, where the authority record has a 5xx. Example: 1. A bibliographic record has a 650 - SUBJECT ADDED ENTRY--TOPICAL TERM: . 650$a = Perl (Computer program language) . 650$9 = 19 2. The authority record (Perl (Computer program language)) has a 550 - SEE ALSO FROM TRACING--TOPICAL TERM: . 550$a = Scripting languages (Computer science) . 550$w = g 3. With the `--embed_see_also_from_headings` option added to `misc/export_records.pl` you get the authority record's 550 information in the export: ``` <datafield tag="650" ind1="z" ind2=" "> <subfield code="a">Scripting languages (Computer science)</subfield> <subfield code="w">g</subfield> </datafield> ```
Version(s) released in:
Circulation function:
Bug Depends on: 31286, 34481    
Bug Blocks:    
Attachments: Bug 32509: Embed see-also-from headings into bibliographic records export
Bug 32509: Embed see-also-from headings into bibliographic records export
Bug 32509: Embed see-also-from headings into bibliographic records export
Bug 32509: Embed see-also-from headings into bibliographic records export
Bug 32509: Embed see-also-from headings into bibliographic records export

Description Fridolin Somers 2022-12-20 19:05:31 UTC
Like Bug 31286 for see-also-forms 5xx
Comment 1 Fridolin Somers 2022-12-20 19:06:13 UTC
I set depending on Bug 31286 for easier rebases.
Comment 2 Fridolin Somers 2022-12-20 22:12:02 UTC
Created attachment 144748 [details] [review]
Bug 32509: Embed see-also-from headings into bibliographic records export
Comment 3 Fridolin Somers 2022-12-20 22:12:54 UTC
This is just the code.

If someone is interested, I will provide test plan and UT.
Comment 4 Fridolin Somers 2022-12-20 22:44:42 UTC
Created attachment 144751 [details] [review]
Bug 32509: Embed see-also-from headings into bibliographic records export
Comment 5 Katrin Fischer 2023-06-10 21:40:00 UTC
Should this be 'needs signoff'?
Comment 6 Fridolin Somers 2023-08-02 22:03:23 UTC
Needs test plan and unit test
Comment 7 Fridolin Somers 2023-08-04 19:24:08 UTC
Maybe should rename Koha::RecordProcessor "EmbedSeeFromHeadings"
For example "EmbedOtherHeadings"
Comment 8 Fridolin Somers 2025-06-16 12:56:12 UTC
Ohhh Bug 34481 is in
Comment 9 Fridolin Somers 2025-12-23 13:41:06 UTC
Created attachment 190692 [details] [review]
Bug 32509: Embed see-also-from headings into bibliographic records export

Patch from commit c2cd6a9
Comment 10 Fridolin Somers 2025-12-23 14:00:33 UTC
Created attachment 190696 [details] [review]
Bug 32509: Embed see-also-from headings into bibliographic records export

In misc/export_records.pl add an option to add see-also-from headings (from authorities 5xx) into bibliographic records export.
Like see-from.

Test plan :
1) Choose a biblio record having a field (for example 650) linked to an authority with a see-also-from.
2) Export this record without see-also-from headings :
   misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_without.xml --format xml
3) Export this record with see-also-from headings :
   misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_with.xml --format xml --embed_see_also_from_headings
4) Compare /tmp/record_without.xml and /tmp/record_with.xml
=> you should see two 650, one with main heading and one with see-also-from heading
Comment 11 Fridolin Somers 2025-12-23 14:01:33 UTC
Sent from https://gitlab.com/koha-community/perl-git-bz ;)
Comment 12 David Nind 2025-12-27 00:26:54 UTC
Created attachment 190743 [details] [review]
Bug 32509: Embed see-also-from headings into bibliographic records export

In misc/export_records.pl add an option to add see-also-from headings (from authorities 5xx) into bibliographic records export.
Like see-from.

Test plan :
1) Choose a biblio record having a field (for example 650) linked to an authority with a see-also-from.
2) Export this record without see-also-from headings :
   misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_without.xml --format xml
3) Export this record with see-also-from headings :
   misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_with.xml --format xml --embed_see_also_from_headings
4) Compare /tmp/record_without.xml and /tmp/record_with.xml
=> you should see two 650, one with main heading and one with see-also-from heading

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2025-12-27 00:44:27 UTC
Testing notes (using KTD):

1. Programming Perl (biblionumber = 262) has a 650 (Perl (Computer program language)) where the authority record (authid = 19) has a 550 (Scripting languages (Computer science)).

2. Attempted a release note with an example.