Bugzilla – Attachment 56383 Details for
Bug 17249
Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesFromField
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory
PASSED-QA-Bug-17249-Remove-GetKohaAuthorisedValues.patch (text/plain), 3.01 KB, created by
Martin Renvoize (ashimema)
on 2016-10-13 12:48:00 UTC
(
hide
)
Description:
[PASSED QA] Bug 17249: Remove GetKohaAuthorisedValuesFromField - inventory
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2016-10-13 12:48:00 UTC
Size:
3.01 KB
patch
obsolete
>From 0ce3ff86acb4af6d470316ceea9feb2b3be36f74 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Aug 2016 12:10:09 +0100 >Subject: [PATCH] [PASSED QA] Bug 17249: Remove > GetKohaAuthorisedValuesFromField - inventory > >This patch deals with the inventory files calling >GetKohaAuthorisedValuesFromField. > >Test plan: > prove t/db_dependent/Items/GetItemsForInventory.t >should still return green > >Use the inventory tool, on the result page the AV descriptions should >correctly replace the codes > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Items/GetItemsForInventory.t | 6 +++++- > tools/inventory.pl | 5 ++++- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t >index 69451f0..32ea963 100755 >--- a/t/db_dependent/Items/GetItemsForInventory.t >+++ b/t/db_dependent/Items/GetItemsForInventory.t >@@ -20,6 +20,8 @@ > use Modern::Perl; > use Test::More tests => 6; > >+use Koha::AuthorisedValues; >+ > $| = 1; > > BEGIN { >@@ -143,7 +145,9 @@ sub OldWay { > my ($f, $sf) = C4::Biblio::GetMarcFromKohaField("items.$field", $row->{'frameworkcode'}); > if (defined($f) and defined($sf)) { > # We replace the code with it's description >- my $authvals = C4::Koha::GetKohaAuthorisedValuesFromField($f, $sf, $row->{'frameworkcode'}); >+ my $av = Koha::AuthorisedValues->search_by_marc_field({ frameworkcode => $row->{frameworkcode}, tagfield => $f, tagsubfield => $sf, }); >+ $av = $av->count ? $av->unblessed : []; >+ my $authvals = { map { ( $_->{authorised_value} => $_->{lib} ) } @$av }; > $row->{$field} = $authvals->{$row->{$field}} if defined $authvals && defined $row->{$field} && defined $authvals->{$row->{$field}}; > } > } >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 74069e5..6531e8d 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -36,6 +36,7 @@ use C4::Circulation; > use C4::Reports::Guided; #_get_column_defs > use C4::Charset; > use Koha::DateUtils; >+use Koha::AuthorisedValues; > use List::MoreUtils qw( none ); > > >@@ -297,7 +298,9 @@ foreach my $item ( @scanned_items ) { > my ($f, $sf) = GetMarcFromKohaField("items.$field", $fc); > if ($f and $sf) { > # We replace the code with it's description >- my $authvals = C4::Koha::GetKohaAuthorisedValuesFromField($f, $sf, $fc); >+ my $av = Koha::AuthorisedValues->search_by_marc_field({ frameworkcode => $fc, tagfield => $f, tagsubfield => $sf, }); >+ $av = $av->count ? $av->unblessed : []; >+ my $authvals = { map { ( $_->{authorised_value} => $_->{lib} ) } @$av }; > if ($authvals and defined $item->{$field} and defined $authvals->{$item->{$field}}) { > $item->{$field} = $authvals->{$item->{$field}}; > } >-- >2.1.4
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 17249
:
55176
|
55177
|
55178
|
55179
|
55180
|
55181
|
55182
|
55428
|
55429
|
55430
|
55431
|
55432
|
55433
|
55434
|
56380
|
56381
|
56382
| 56383 |
56384
|
56385
|
56386