Bug 37710 - Remove the marc link when removing an item from a bundle
Summary: Remove the marc link when removing an item from a bundle
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on: 37996
Blocks: 38093
  Show dependency treegraph
 
Reported: 2024-08-22 14:09 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2024-10-04 12:44 UTC (History)
2 users (show)

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


Attachments
Bug 37710: Remove the marc link when removing an item from a bundle (3.09 KB, patch)
2024-09-20 15:06 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 37710: Add unit tests (4.33 KB, patch)
2024-09-24 13:45 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 37710: Remove the marc link when removing an item from a bundle (3.28 KB, patch)
2024-09-24 13:45 UTC, Baptiste Wojtkowski (bwoj)
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-08-22 14:09:25 UTC
A new functionality to automatically add a new MARC link has been added in Bug 29560 (Add option to create MARC links when adding items to bundles). There should also be a way to remove this link when removing the item from the bundle.

Moreover I don't know if this should be a second bug but since the link is not removed, there can be multiple links if the item is added to a new bundle.
Comment 1 Baptiste Wojtkowski (bwoj) 2024-09-20 15:06:55 UTC
Created attachment 171832 [details] [review]
Bug 37710: Remove the marc link when removing an item from a bundle

A new functionality to automatically add a new MARC link has been added in Bug 29560 (Add option to create MARC links when adding items to bundles). There should also be a way to remove this link when removing the item from the bundle.

Moreover I don't know if this should be a second bug but since the link is not removed, there can be multiple links if the item is added to a new bundle.

TEST PLAN:
1 - Create a bundle on an item by changing the 7th character of the
  leader to c (go to the marc, click on the button at the right of the
          field 000 and change the bibliographical level to collection).
2 - Add an item to the bundle (on the biblio, exemplars will have a
  button "manage bundle"->add_to_bundle, fill in a barcode and check "add MARC link")
3 - Check on the MARC that field 461 (UNIMARC) or 773 (MARC21) is
  propperly filled
4 - Remove the item from the bundle
5 - Check that the marc field is still there and remove it manually
6 - APPLY PATCH
7 - Repeat 2-5 -> the field should have been automatically removed
Comment 2 Lucas Gass (lukeg) 2024-09-21 15:21:53 UTC
Can we get some unit tests to cover unlink_marc_host?
Comment 3 Baptiste Wojtkowski (bwoj) 2024-09-24 13:45:35 UTC
Created attachment 171933 [details] [review]
Bug 37710: Add unit tests
Comment 4 Baptiste Wojtkowski (bwoj) 2024-09-24 13:45:37 UTC
Created attachment 171934 [details] [review]
Bug 37710: Remove the marc link when removing an item from a bundle

A new functionality to automatically add a new MARC link has been added in Bug 29560 (Add option to create MARC links when adding items to bundles). There should also be a way to remove this link when removing the item from the bundle.

Moreover I don't know if this should be a second bug but since the link is not removed, there can be multiple links if the item is added to a new bundle.

TEST PLAN:
1 - Apply tests and prove t/db_dependent/Koha/Biblio.t -> should fail
2 - Create a bundle on an item by changing the 7th character of the
  leader to c (go to the marc, click on the button at the right of the
          field 000 and change the bibliographical level to collection).
3 - Add an item to the bundle (on the biblio, exemplars will have a
  button "manage bundle"->add_to_bundle, fill in a barcode and check "add MARC link")
4 - Check on the MARC that field 461 (UNIMARC) or 773 (MARC21) is
  propperly filled
5 - Remove the item from the bundle
6 - Check that the marc field is still there and remove it manually
7 - APPLY PATCH
8 - Repeat 2-5 -> the field should have been automatically removed
9 - Run tests -> should pass

Note: as for link_marc_host, tests assume you are using MARC21
Comment 5 Baptiste Wojtkowski (bwoj) 2024-09-24 13:47:21 UTC
Note : 
In order to prove the behavior properly, I had to create Bug 37996