From 64c7f0515e9d712701c9043e27e2be9322c50a62 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 6 Apr 2018 07:57:32 +0200 Subject: [PATCH] Bug 18816: (QA follow-up) Framework parameter is not needed Content-Type: text/plain; charset=utf-8 $frameworkcode is not used in ModItem (no need to pass it in ModItemFromMarc). $dbh is not used in ModItem. Test plan: Run t/db_dependent/Items.t Signed-off-by: Marcel de Rooy --- C4/Items.pm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index e39ebf7..e7279ff 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -510,7 +510,7 @@ sub ModItemFromMarc { } my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); - ModItem($item, $biblionumber, $itemnumber, { frameworkcode => $frameworkcode, unlinked_item_subfields => $unlinked_item_subfields } ); + ModItem( $item, $biblionumber, $itemnumber, { unlinked_item_subfields => $unlinked_item_subfields } ); return $item; } @@ -522,7 +522,6 @@ ModItem( $itemnumber, { [ unlinked_item_subfields => $unlinked_item_subfields, ] - [ frameworkcode => $frameworkcode, ] [ log_action => 1, ] } ); @@ -533,9 +532,11 @@ the MARC representation of the item. The first argument is a hashref mapping from item column names to the new values. The second and third arguments are the biblionumber and itemnumber, respectively. +The fourth, optional parameter (additional_params) may contain the keys +unlinked_item_subfields and log_action. -The fourth, optional parameter, C<$unlinked_item_subfields>, contains -an arrayref containing subfields present in the original MARC +C<$unlinked_item_subfields> contains an arrayref containing +subfields present in the original MARC representation of the item (e.g., from the item editor) that are not mapped to C columns directly but should instead be stored in C and included in @@ -552,16 +553,9 @@ If log_action is true or undefined, the action will be logged. =cut sub ModItem { - my $item = shift; - my $biblionumber = shift; - my $itemnumber = shift; - my $additional_params = shift; - - my $dbh = C4::Context->dbh; - + my ( $item, $biblionumber, $itemnumber, $additional_params ) = @_; my $log_action = $additional_params->{log_action} // 1; my $unlinked_item_subfields = $additional_params->{unlinked_item_subfields}; - my $frameworkcode = $additional_params->{frameworkcode} || C4::Biblio::GetFrameworkCode($biblionumber); # if $biblionumber is undefined, get it from the current item unless (defined $biblionumber) { -- 2.1.4