Bug 28854 adds the ability to bundle items together for circulation as collections. It may be useful to optionally allow the action of adding an item into a bundle to trigger the creation of MARC field links in the constituent items biblio.
What I'm thinking is adding a checkbox to the add to bundle modal that allows adding '773' links to the child as it's added to the bundle.
Created attachment 135090 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio.
Created attachment 135091 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added.
Work in progress.. I believe is should all be working as expected but we need to add tests and I'd love some feedback on the implementation with respect to the very similar functions in C4::Biblio for preparing a host link field.
Perhaps this could/should also be tied to a preference.. 'BundleContentsFrom' or something that allows the librarian to pick from what data source content lists should be built.. MARC Field or First bundle item perhaps?
Created attachment 137509 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio.
Created attachment 137510 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added.
Noone interested in this?
Created attachment 156299 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio.
Created attachment 156300 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added.
Rebased and ready for testing again.
Created attachment 159081 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 159082 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Could we get some unit tests for link_marc_host?
Created attachment 168720 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168721 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168722 [details] [review] Bug 29560: (follow-up) Split prepare and store logic This allows for future removal of C4::Biblio::prepare_marc_host by splitting the logic for generating the host field and storing the link in the child record.
Created attachment 168723 [details] [review] Bug 29560: Unit tests
Rebased, a tiny bit of refactoring for thinking about future removal of old code and unit tests added. Back to signed off and ready for QA.
Can you please address the QA script issue: FAIL Koha/REST/V1/Items.pm OK critic FAIL forbidden patterns forbidden pattern: Use of $c->validation in API controllers should be avoided (bug 33556) (line 319) and be able to add a unit test for the rest api change? Thanks!
Created attachment 168816 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168817 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168818 [details] [review] Bug 29560: (follow-up) Split prepare and store logic This allows for future removal of C4::Biblio::prepare_marc_host by splitting the logic for generating the host field and storing the link in the child record.
Created attachment 168819 [details] [review] Bug 29560: Unit tests
Created attachment 168820 [details] [review] Bug 29560: Unit tests: API
Created attachment 168821 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168822 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi>
Created attachment 168823 [details] [review] Bug 29560: (follow-up) Split prepare and store logic This allows for future removal of C4::Biblio::prepare_marc_host by splitting the logic for generating the host field and storing the link in the child record.
Created attachment 168824 [details] [review] Bug 29560: Unit tests
Created attachment 168825 [details] [review] Bug 29560: Unit tests: API
Doh.. main moved! Rebased again
Created attachment 168885 [details] [review] Bug 29560: Add link_marc_host to Koha::Biblio This patch adds the new `link_marc_host` method to Koha::Biblio to facilitate adding a host link to the marc record of this biblio. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 168886 [details] [review] Bug 29560: Add option to create MARC Links when bundling items This patch add a checkbox to the 'Add to bundle' modal allowing the user to optionally add MARC links between the new child record and the current biblio. For MARC21 this will result in a 773 pointing to the host from the item record and for UNIMARC a 461 field will be added. Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 168887 [details] [review] Bug 29560: (follow-up) Split prepare and store logic This allows for future removal of C4::Biblio::prepare_marc_host by splitting the logic for generating the host field and storing the link in the child record. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 168888 [details] [review] Bug 29560: Unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 168889 [details] [review] Bug 29560: Unit tests: API Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
FOR THIS PATCH SET: 1) Is the comma here correct/intended? $sfd{w} = $host_field->data(),; FOR OTHER BUGS (if you want): 1) I think we should adjust to also take RDA records using 264 into account here. At least for us these are now the majority of records. + # Publication + if ( $host_field = $marc_host->field('260') ) { + my $s = $host_field->as_string('abc'); + if ($s) { + $sfd{d} = $s; + } + } 2) This should take $n$p into account as well, as otherwise a multi-part work will not be distinguishable from the title: + # Title + if ( $host_field = $marc_host->field('245') ) { + my $s = $host_field->as_string('ab'); + if ($s) { + $sfd{t} = $s; + } + }
Pushed for 24.11! Well done everyone, thank you!
(In reply to Katrin Fischer from comment #37) > FOR THIS PATCH SET: > > 1) Is the comma here correct/intended? > > $sfd{w} = $host_field->data(),; That's certainly a typo. > > FOR OTHER BUGS (if you want): > > 1) I think we should adjust to also take RDA records using 264 into account > here. At least for us these are now the majority of records. > > + # Publication > + if ( $host_field = $marc_host->field('260') ) { > + my $s = $host_field->as_string('abc'); > + if ($s) { > + $sfd{d} = $s; > + } > + } > > > 2) This should take $n$p into account as well, as otherwise a multi-part > work will not be distinguishable from the title: > > + # Title > + if ( $host_field = $marc_host->field('245') ) { > + my $s = $host_field->as_string('ab'); > + if ($s) { > + $sfd{t} = $s; > + } > + } I'm more than happy to be guided on cataloguing standards.. I'm a mere dev without enough real cataloging knowledge to get this 100% right without guidance :)
Created attachment 168968 [details] [review] Bug 29560: (follow-up) Clean up trailing comma Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Follow-up pushed to main.
I filed: Bug 37364 - Improve creation of 773 fields for item bundles regarding MARC21 245 and 264 Removing additional_work_needed.