Bugzilla – Attachment 140670 Details for
Bug 31503
Allow several consent types on the consents tab of OPAC account page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31503: Add $av_cat->values
Bug-31503-Add-avcat-values.patch (text/plain), 1.97 KB, created by
Marcel de Rooy
on 2022-09-15 13:56:26 UTC
(
hide
)
Description:
Bug 31503: Add $av_cat->values
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-15 13:56:26 UTC
Size:
1.97 KB
patch
obsolete
>From 43d66fe35c6448d92953f1c92ddedd81f80147ee Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 1 Sep 2022 11:56:40 +0000 >Subject: [PATCH] Bug 31503: Add $av_cat->values >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/AuthorisedValues.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/AuthorisedValueCategory.pm | 12 ++++++++++++ > t/db_dependent/AuthorisedValues.t | 10 +++++++++- > 2 files changed, 21 insertions(+), 1 deletion(-) > >diff --git a/Koha/AuthorisedValueCategory.pm b/Koha/AuthorisedValueCategory.pm >index e14129f80d..749c866500 100644 >--- a/Koha/AuthorisedValueCategory.pm >+++ b/Koha/AuthorisedValueCategory.pm >@@ -47,6 +47,18 @@ sub delete { > return $self->SUPER::delete; > } > >+=head3 authorized_values >+ >+Returns values within the category at hand. >+ >+=cut >+ >+sub values { >+ my ( $self ) = @_; >+ my $rs = $self->_result->authorised_values; >+ return map { $_->authorised_value } $rs->all; >+} >+ > =head3 type > > =cut >diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t >index e9f64ed5db..a0ec904af6 100755 >--- a/t/db_dependent/AuthorisedValues.t >+++ b/t/db_dependent/AuthorisedValues.t >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 16; >+use Test::More tests => 17; > use Try::Tiny; > > use t::lib::TestBuilder; >@@ -254,4 +254,12 @@ subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { > }; > }; > >+subtest '$category->values' => sub { >+ plan tests => 1; >+ Koha::AuthorisedValueCategory->new( { category_name => 'VALUES_TEST' } )->store; >+ Koha::AuthorisedValue->new({ category => 'VALUES_TEST', authorised_value => 'test1' })->store; >+ Koha::AuthorisedValue->new({ category => 'VALUES_TEST', authorised_value => 'test2' })->store; >+ is_deeply( [ sort Koha::AuthorisedValueCategories->find('VALUES_TEST')->values ], [ 'test1', 'test2' ], 'Expecting two values' ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.30.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 31503
:
140047
|
140048
|
140049
|
140050
|
140080
|
140081
|
140082
|
140083
|
140084
|
140085
|
140087
|
140088
|
140089
|
140090
|
140666
|
140667
|
140668
|
140669
|
140670
|
140671
|
140672
|
141216
|
141217
|
141218
|
141219
|
141220
|
141221
|
141222
|
141263
|
141264
|
141265
|
141266
|
141267
|
141268
|
141269
|
141302
|
141570
|
155000
|
155001
|
155002
|
155003
|
155177
|
155178
|
155179
|
155180
|
155189
|
155190
|
155191
|
155656
|
155657
|
155658
|
155659
|
155660
|
155661
|
155691
|
155694
|
155783
|
155784
|
155785
|
155786
|
155787
|
155788
|
155789
|
155790
|
155791
|
157117
|
157118
|
157119
|
157120
|
157121
|
157122
|
157123
|
157124
|
157125
|
157126
|
157773
|
157774
|
157775
|
157776
|
157777
|
157778
|
157779
|
157780
|
157781
|
157782
|
157783