Bugzilla – Attachment 76004 Details for
Bug 20760
Advanced Cataloging Editor - Rancor - AuthorisedValues are incorrectly fetched
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20760: Fill authorised values in svc framework
Bug-20760-Fill-authorised-values-in-svc-framework.patch (text/plain), 2.47 KB, created by
Martin Renvoize (ashimema)
on 2018-06-12 15:58:34 UTC
(
hide
)
Description:
Bug 20760: Fill authorised values in svc framework
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-06-12 15:58:34 UTC
Size:
2.47 KB
patch
obsolete
>From aaa49a7c811c3b84eac44bb8683af566a0a3661b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Jun 2018 13:02:33 -0300 >Subject: [PATCH] Bug 20760: Fill authorised values in svc framework > >To test: > 1 - Map a marc field to an authorised value in the default framework - >say 300$c -> CCODE > 2 - Open the advanced cataloguing editor > 3 - Create a new field 300$c - note there is no dropdown > 4 - browse to: /cgi-bin/koha/svc/cataloguing/framework?callback=define > 5 - Note the many instance of >Koha::Schema::ResultSet::AuthorisedValueCategory->HASH... > 6 - Apply patch > 7 - Restart memcached and plack > 8 - reload/recreate record in rancor > 9 - Note that 300$c is now a dropdown as expected >10 - repeate 4 >11 - note the authorised values look correct in response > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > svc/cataloguing/framework | 19 ++++--------------- > 1 file changed, 4 insertions(+), 15 deletions(-) > >diff --git a/svc/cataloguing/framework b/svc/cataloguing/framework >index 4880b8abdb..ec9108f222 100755 >--- a/svc/cataloguing/framework >+++ b/svc/cataloguing/framework >@@ -6,6 +6,7 @@ use CGI; > use C4::ClassSource; > use C4::Context; > use C4::Biblio; >+use C4::Koha; > use C4::Service; > use Koha::Database; > use Koha::Libraries; >@@ -51,21 +52,9 @@ foreach my $class_source (sort keys %$class_sources) { > push @{ $authorised_values->{cn_source} }, { value => $class_source, lib => $class_sources->{$class_source}->{'description'} }; > } > >-my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >-my $results; >-if( $branch_limit ) { >- $results = $schema->resultset( "AuthorisedValue" )->search( >- { "authorised_values_branches.branchcode" => { "=", [ $branch_limit, undef ] } }, >- { join => "authorised_values_branches", order_by => "lib" } ); >-} else { >- $results = $schema->resultset( "AuthorisedValue" )->search( >- undef, >- { order_by => "lib" } ); >-} >- >-foreach my $result ( $results->all ) { >- $authorised_values->{$result->category} ||= []; >- push @{ $authorised_values->{$result->category} }, { value => $result->authorised_value, lib => $result->lib }; >+my $avs = C4::Koha::GetAuthorisedValues(); >+for my $av ( @$avs ) { >+ push @{ $authorised_values->{$av->{category}} }, { value => $av->{authorised_value}, lib => $av->{lib} }; > } > > $response->param( framework => \@tags, authorised_values => $authorised_values ); >-- >2.14.2
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 20760
:
75291
|
75779
|
76003
| 76004