From 03a645bb51aab1164d452b0720945f3ac87a7d3f Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 5 Apr 2023 12:49:59 +0000 Subject: [PATCH] Bug 33419: POC untested This will require testing, and better instructions on how to match etc. To test: 1 - Supply a value for 'framework' and 'overlay_framework' in the connxion.conf file 2 - Setup connexion, there is some help here on testing values: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15720 3 - Test importing bibs that match, and that don't match 4 - Confirm the framework value is used for new records 5 - Confirm if framework is blank the default framework is used for new records 6 - Confirm if framework is not supplied the default framework is used for new records 7 - Confirm a matching record that overlays obeys the overlay_framework param 8 - Confirm overlayed record uses default framework if the param is blank 9 - Confirm the original records framework is retained if the param is not passed https://bugs.koha-community.org/show_bug.cgi?id=33418 --- misc/bin/connexion_import_daemon.pl | 6 +++++- svc/import_bib | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/misc/bin/connexion_import_daemon.pl b/misc/bin/connexion_import_daemon.pl index c7e06c3a7d..07b262c232 100755 --- a/misc/bin/connexion_import_daemon.pl +++ b/misc/bin/connexion_import_daemon.pl @@ -55,11 +55,13 @@ Config file format: password - koha user password, authentication match - marc_matchers.code: ISBN or ISSN overlay_action - import_batches.overlay_action: replace, create_new or ignore + overlay_framework - if overlaying records - move to a new framework, if blank will use default + if not included it will use the framework of the existing record nomatch_action - import_batches.nomatch_action: create_new or ignore item_action - import_batches.item_action: always_add, add_only_for_matches, add_only_for_new or ignore import_mode - stage or direct - framework - to be used if import_mode is direct + framework - to be used if import_mode is direct, if blank, will use default connexion_user - User sent from connexion client connexion_password - Password sent from connexion client @@ -359,6 +361,7 @@ sub handle_request { 'match' => $self->{params}->{match}, 'import_mode' => $self->{params}->{import_mode}, 'framework' => $self->{params}->{framework}, + 'overlay_framework' => $self->{params}->{overlay_framework}, 'item_action' => $self->{params}->{item_action}, 'xml' => $data}); @@ -373,6 +376,7 @@ sub handle_request { 'match' => $self->{params}->{match}, 'import_mode' => $self->{params}->{import_mode}, 'framework' => $self->{params}->{framework}, + 'overlay_framework' => $self->{params}->{overlay_framework}, 'item_action' => $self->{params}->{item_action}, 'xml' => $data}) if $resp->is_success; diff --git a/svc/import_bib b/svc/import_bib index d5727e6589..74ef7c9bda 100755 --- a/svc/import_bib +++ b/svc/import_bib @@ -60,6 +60,7 @@ sub import_bib { my $import_mode = delete $params->{import_mode} || ''; my $framework = delete $params->{framework} || ''; + my $overlay_framework = delete $params->{overlay_framework} || ''; if (my $matcher_code = delete $params->{match}) { $params->{matcher_id} = C4::Matcher::GetMatcherId($matcher_code); @@ -94,7 +95,8 @@ sub import_bib { # XXX we are ignoring the result of this; BatchCommitRecords({ batch_id => $batch_id, - framework => $framework + framework => $framework, + overlay_framework => $overlay_framework }) if lc($import_mode) eq 'direct'; my $dbh = C4::Context->dbh(); -- 2.30.2