Bugzilla – Attachment 105219 Details for
Bug 20817
Add ability to retain 9xx fields when adding on order item to existing record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20817: Remove syspref from parameters, it is invariant
Bug-20817-Remove-syspref-from-parameters-it-is-inv.patch (text/plain), 5.89 KB, created by
Kyle M Hall
on 2020-05-21 15:12:46 UTC
(
hide
)
Description:
Bug 20817: Remove syspref from parameters, it is invariant
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2020-05-21 15:12:46 UTC
Size:
5.89 KB
patch
obsolete
>From e698212dafa43511a06271d5c9e54d457119dda7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 21 May 2020 10:40:44 -0400 >Subject: [PATCH] Bug 20817: Remove syspref from parameters, it is invariant > >--- > Koha/Acquisition/Utils.pm | 8 ++++---- > acqui/addorderiso2709.pl | 4 ++-- > acqui/neworderempty.pl | 4 ++-- > t/Acquisition/Utils.t | 3 --- > 4 files changed, 8 insertions(+), 11 deletions(-) > >diff --git a/Koha/Acquisition/Utils.pm b/Koha/Acquisition/Utils.pm >index 74ca963276..608c92eb4f 100644 >--- a/Koha/Acquisition/Utils.pm >+++ b/Koha/Acquisition/Utils.pm >@@ -39,8 +39,8 @@ given system preference. > =cut > > sub GetMarcFieldsToOrderValues { >- my ($syspref_name, $record, $field_list) = @_; >- my $syspref = C4::Context->preference($syspref_name); >+ my ($record, $field_list) = @_; >+ my $syspref = C4::Context->preference('MarcFieldsToOrder'); > $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt > my $yaml = eval { > YAML::Load($syspref); >@@ -83,8 +83,8 @@ find a matching number of all fields to be looked up. > =cut > > sub GetMarcItemFieldsToOrderValues { >- my ($syspref_name, $record, $field_list) = @_; >- my $syspref = C4::Context->preference($syspref_name); >+ my ($record, $field_list) = @_; >+ my $syspref = C4::Context->preference('MarcItemFieldsToOrder'); > $syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt > my $yaml = eval { > YAML::Load($syspref); >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 8b72498e78..e74256b4a8 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -513,7 +513,7 @@ sub import_biblios_list { > my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); > my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; > >- my $infos = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']); >+ my $infos = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues( $marcrecord, [ 'price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2', 'replacementprice' ] ); > my $price = $infos->{price}; > my $replacementprice = $infos->{replacementprice}; > my $quantity = $infos->{quantity}; >@@ -532,7 +532,7 @@ sub import_biblios_list { > # Items > my @itemlist = (); > my $all_items_quantity = 0; >- my $alliteminfos = C4::Acquisition::Utils::GetMarcItemFieldsToOrderValues('MarcItemFieldsToOrder', $marcrecord, ['homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code']); >+ my $alliteminfos = C4::Acquisition::Utils::GetMarcItemFieldsToOrderValues( $marcrecord, [ 'homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code' ] ); > if ($alliteminfos != -1) { > foreach my $iteminfos (@$alliteminfos) { > my $item_homebranch = $iteminfos->{homebranch}; >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 27855e014d..07fa82be7c 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -619,7 +619,7 @@ sub staged_items_field { > my ($marcrecord, $encoding) = MARCfindbreeding($breedingid); > die("Could not find the selected record in the reservoir, bailing") unless $marcrecord; > >- my $infos = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2', 'replacementprice']); >+ my $infos = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues( $marcrecord, [ 'price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2', 'replacementprice' ] ); > my $price = $infos->{price}; > my $replacementprice = $infos->{replacementprice}; > my $quantity = $infos->{quantity}; >@@ -637,7 +637,7 @@ sub staged_items_field { > # Items > my @itemlist = (); > my $all_items_quantity = 0; >- my $alliteminfos = C4::Acquisition::Utils::GetMarcItemFieldsToOrderValues('MarcItemFieldsToOrder', $marcrecord, ['homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code']); >+ my $alliteminfos = C4::Acquisition::Utils::GetMarcItemFieldsToOrderValues( $marcrecord, [ 'homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code' ] ); > if ($alliteminfos != -1) { > foreach my $iteminfos (@$alliteminfos) { > my %itemrecord=( >diff --git a/t/Acquisition/Utils.t b/t/Acquisition/Utils.t >index 6cc043ce84..6105402e81 100755 >--- a/t/Acquisition/Utils.t >+++ b/t/Acquisition/Utils.t >@@ -52,7 +52,6 @@ test4: 541$a > }; > t::lib::Mocks::mock_preference('MarcFieldsToOrder', $MarcFieldsToOrder); > my $data = Koha::Acquisition::Utils::GetMarcFieldsToOrderValues( >- 'MarcFieldsToOrder', > $record, > [ 'test1', 'test2', 'test3', 'test4' ] > ); >@@ -86,7 +85,6 @@ testD: 976$b > }; > t::lib::Mocks::mock_preference('MarcItemFieldsToOrder', $MarcItemFieldsToOrder); > my $data = Koha::Acquisition::Utils::GetMarcItemFieldsToOrderValues( >- 'MarcItemFieldsToOrder', > $record, > [ 'testA', 'testB', 'testC', 'testD' ] > ); >@@ -117,7 +115,6 @@ testD: 976$b > ); > > $data = Koha::Acquisition::Utils::GetMarcItemFieldsToOrderValues( >- 'MarcItemFieldsToOrder', > $record, > [ 'testA', 'testB', 'testC', 'testD' ] > ); >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20817
:
79867
|
80537
|
86711
|
86746
|
105214
|
105215
|
105216
|
105217
|
105218
|
105219
|
115343
|
118371
|
118372
|
118373
|
118374
|
118375
|
118376
|
118377
|
118378
|
122692
|
122834
|
122841
|
122858
|
122861
|
128766
|
128767
|
128768
|
128769
|
128770
|
128771
|
128772
|
128773
|
128774
|
128775
|
128776
|
128777
|
128782
|
128783
|
128785
|
128786
|
128787
|
128788
|
128789
|
128790
|
128791
|
128792
|
128793
|
128794
|
128795
|
128796
|
128797
|
128798
|
131732
|
131733
|
131734
|
131735
|
131736
|
131737
|
131738
|
131739
|
131740
|
131741
|
131742
|
131743
|
131744
|
131745
|
131746
|
131747
|
131748
|
131749
|
142630
|
142631
|
142632
|
142633
|
142634
|
142635
|
142636
|
142637
|
142638
|
142639
|
142640
|
142641
|
142642
|
142643
|
142644
|
142645
|
142646
|
142647
|
142648
|
142649
|
142650
|
142651
|
142829