Bug 38093 - Bundles: Add MARC link options should also add a link in 462
Summary: Bundles: Add MARC link options should also add a link in 462
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 24.05
Hardware: All All
: P5 - low enhancement
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on: 37710
Blocks: 41535
  Show dependency treegraph
 
Reported: 2024-10-04 08:27 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2026-01-08 06:42 UTC (History)
4 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
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 38093: Add unit tests (4.86 KB, patch)
2024-10-04 13:06 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38093: Bundles: Add MARC link options should also add a link in 462 (3.51 KB, patch)
2024-10-04 13:06 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38093: Bundles: Remove the link created in 462 when removing from the bundle (2.20 KB, patch)
2024-10-04 13:06 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38093: Bundles: Add MARC link options should also add a link in 462 (3.51 KB, patch)
2025-02-06 14:10 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38093: Bundles: Remove the link created in 462 when removing from the bundle (2.23 KB, patch)
2025-02-06 14:11 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38093: Bundles: (QA follow-up) fix small error in parameter name (1.21 KB, patch)
2026-01-06 20:48 UTC, Arthur Suzuki
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2024-10-04 08:27:10 UTC

    
Comment 1 Baptiste Wojtkowski (bwoj) 2024-10-04 12:50:29 UTC
Bundle implementation in Bug 37996 does not implement marc representation of the relation between bundles and items they contain.

Bug 29560 creates a link (773 in MARC21, 461 in UNIMARC) from the item in the bundle to the bundle itself.

We also should also add a MARC link from the bundle to the item contained in the dedicated field (774 in MARC21, 462 in UNIMARC).
Comment 2 Baptiste Wojtkowski (bwoj) 2024-10-04 13:06:05 UTC
Created attachment 172395 [details] [review]
Bug 38093: Add unit tests
Comment 3 Baptiste Wojtkowski (bwoj) 2024-10-04 13:06:07 UTC
Created attachment 172396 [details] [review]
Bug 38093: Bundles: Add MARC link options should also add a link in 462

Bundle implementation in Bug 37996 does not implement marc representation of the relation between bundles and items they contain.

Bug 29560 creates a link (773 in MARC21, 461 in UNIMARC) from the item in the bundle to the bundle itself.

We also should also add a MARC link from the bundle to the item contained in the dedicated field (774 in MARC21, 462 in UNIMARC).

TEST PLAN:
1 - Apply patches
2 - Create a bundle item (cf after for more info on this step if you are
  unfamiliar with bundles)
3 - Click on "manage bundle", fill with an existing barcode, click on
  Add marc link
4 - Click on MARC -> tab 7 (on marc21) and tab 4 on unimarc -> there
  should be a link in field 733 (marc21) or 462 (unimarc)
5 - Go back to the bundle and remove the item from the bundle.
6 - Click again on MARC -> precedent fields should now be empty

Create a bundle :
1 - Create a new biblio/Edit an existing one, edit the field 000, the field
7 must be set to c-Collection.
2 - Go on the biblio and create a new item attached to the biblio
3 - You should see an icon "Manage bundle" on the item created
Comment 4 Baptiste Wojtkowski (bwoj) 2024-10-04 13:06:10 UTC
Created attachment 172397 [details] [review]
Bug 38093: Bundles: Remove the link created in 462 when removing from the bundle
Comment 5 Thibault Keromnès 2025-01-13 13:30:36 UTC
Tried both on KTD and a sandbox, ending with the same error : 
error: sha1 information is lacking or useless (Koha/Biblio.pm).
error: could not build fake ancestor
Patch failed at 0001 Bug 38093: Bundles: Remove the link created in 462 when removing from the bundle
Comment 6 Baptiste Wojtkowski (bwoj) 2025-02-06 14:10:59 UTC
Created attachment 177573 [details] [review]
Bug 38093: Bundles: Add MARC link options should also add a link in 462

Bundle implementation in Bug 37996 does not implement marc representation of the relation between bundles and items they contain.

Bug 29560 creates a link (773 in MARC21, 461 in UNIMARC) from the item in the bundle to the bundle itself.

We also should also add a MARC link from the bundle to the item contained in the dedicated field (774 in MARC21, 462 in UNIMARC).

TEST PLAN:
1 - Apply patches
2 - Create a bundle item (cf after for more info on this step if you are
  unfamiliar with bundles)
3 - Click on "manage bundle", fill with an existing barcode, click on
  Add marc link
4 - Click on MARC -> tab 7 (on marc21) and tab 4 on unimarc -> there
  should be a link in field 733 (marc21) or 462 (unimarc)
5 - Go back to the bundle and remove the item from the bundle.
6 - Click again on MARC -> precedent fields should now be empty

Create a bundle :
1 - Create a new biblio/Edit an existing one, edit the field 000, the field
7 must be set to c-Collection.
2 - Go on the biblio and create a new item attached to the biblio
3 - You should see an icon "Manage bundle" on the item created
Comment 7 Baptiste Wojtkowski (bwoj) 2025-02-06 14:11:02 UTC
Created attachment 177574 [details] [review]
Bug 38093: Bundles: Remove the link created in 462 when removing from the bundle
Comment 8 Victor Grousset/tuxayo 2025-03-12 03:55:08 UTC
blocked: following dependencies leads Bug 37996

If I understand correctly, it shouldn't be in the need signoff queue because changes to Bug 37996 would likely invalidate testing.
Comment 9 Arthur Suzuki 2026-01-06 20:39:59 UTC
Hi Victor,
I've made some work to get things moving, I think this patch can no longer be considered as "BLOCKED" since the patch it was relying upon has been resolved as duplicate.
I've removed the dependency to the duplicate and with minor changes to previous patches was able to apply that one.
There is a small typo in the first patch which should be fixed this way :
<pre>
kohadev-koha@kohadevbox:koha(malles)$ git diff
diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm
index d8e378f47e4..579027d1b9b 100644
--- a/Koha/Biblio.pm
+++ b/Koha/Biblio.pm
@@ -2220,7 +2220,7 @@ sub link_marc_bundled_item {
     if ( ref( $params->{bundled_item} ) eq 'Koha::Item' ) {
         $bundled_item = $params->{bundled_item};
     } else {
-        my $bundled_item = Koha::Items->find( $params->{host} );
+        my $bundled_item = Koha::Items->find( $params->{bundled_item} );
     }
 
     my $record = $self->metadata->record;
</pre>

Also the test plan has another typo (says 733 in step 4, it should be 774).
Test plan may also document that 774 subfields 0,9 and t should be configured in the marc framework, and systempreference "EasyAnalyticalRecords" set to 1.
Otherwise it may not work.
I'm setting this patch to In Discussion because it needs some changes which I need to discuss a bit further with BibLibre's colleagues before submitting.
Arthur
Comment 10 Arthur Suzuki 2026-01-06 20:48:17 UTC
Created attachment 190961 [details] [review]
Bug 38093: Bundles: (QA follow-up) fix small error in parameter name
Comment 11 Arthur Suzuki 2026-01-08 06:42:13 UTC
This patch set is ready for signoff!