Bugzilla – Attachment 49035 Details for
Bug 15870
Add Filter for MARC to respect visibility settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15870: Follow up to address comment #20
SIGNED-OFFBug-15870-Follow-up-to-address-comment-2.patch (text/plain), 3.86 KB, created by
Héctor Eduardo Castro Avalos
on 2016-03-11 15:01:10 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15870: Follow up to address comment #20
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-03-11 15:01:10 UTC
Size:
3.86 KB
patch
obsolete
>From 824c3dfec9a1df978f98dca345e252d4582d1ce7 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 11 Mar 2016 08:34:22 -0500 >Subject: [PATCH] [SIGNED-OFF]Bug 15870: Follow up to address comment #20 > >- $OUTPUT_AUTOFLUSH wasn't used to it was removed >- Use English was removed since $OUTPUT_AUTOFLUSH wasn't not needed >- transaction start and end were moved to subtests >- prepare was moved outside loop >- partial MARC agnosticism was added > >TEST PLAN >--------- >1) apply patch >2) prove t/db_dependent/Filter_MARC_ViewPolicy.t >3) run koha qa test tools > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >--- > t/db_dependent/Filter_MARC_ViewPolicy.t | 47 +++++++++++++++++-------------- > 1 file changed, 26 insertions(+), 21 deletions(-) > >diff --git a/t/db_dependent/Filter_MARC_ViewPolicy.t b/t/db_dependent/Filter_MARC_ViewPolicy.t >index 09e567b..ba446bc 100644 >--- a/t/db_dependent/Filter_MARC_ViewPolicy.t >+++ b/t/db_dependent/Filter_MARC_ViewPolicy.t >@@ -29,16 +29,20 @@ use List::MoreUtils qw/any/; > use MARC::Record; > use MARC::Field; > use C4::Context; >+use C4::Biblio; > use Koha::Cache qw/flush_all/; > use Koha::Database; >-use English qw/-no_match_vars/; >- >-$OUTPUT_AUTOFLUSH = 1; > > BEGIN { > use_ok('Koha::RecordProcessor'); > } > >+my $dbh = C4::Context->dbh; >+ >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+$dbh->{RaiseError} = 1; >+ > sub run_hiding_tests { > > my $interface = shift; >@@ -54,23 +58,17 @@ sub run_hiding_tests { > 'intranet' => [ -8, -7, -4, -3, -2, 2, 3, 5, 8 ] > }; > >- my $dbh = C4::Context->dbh; >- >- my $database = Koha::Database->new(); >- my $schema = $database->schema(); >- $dbh->{RaiseError} = 1; >- >- #$ENV{'DEBUG'} = '1'; # Turn on debugging. >- >+ my ( $isbn_field, $isbn_subfield ) = >+ GetMarcFromKohaField( 'biblioitems.isbn', q{} ); >+ my $update_sql = >+ q{UPDATE marc_subfield_structure SET hidden=? } >+ . q{WHERE tagfield='} >+ . $isbn_field >+ . q{' OR } >+ . q{ tagfield='008';}; >+ my $sth = $dbh->prepare($update_sql); > foreach my $hidden_value (@valid_hidden_values) { > >- $schema->storage->txn_begin(); >- >- my $update_sql = >- q{UPDATE marc_subfield_structure SET hidden=? } >- . q{WHERE tagfield='020' OR } >- . q{ tagfield='008';}; >- my $sth = $dbh->prepare($update_sql); > $sth->execute($hidden_value); > > my $cache = Koha::Cache->get_instance(); >@@ -139,21 +137,24 @@ sub run_hiding_tests { > 'Records are the same' ); > } > >- $schema->storage->txn_rollback(); > } > return; > } > > sub create_marc_record { > >+ my ( $title_field, $title_subfield ) = >+ GetMarcFromKohaField( 'biblio.title', q{} ); >+ my ( $isbn_field, $isbn_subfield ) = >+ GetMarcFromKohaField( 'biblioitems.isbn', q{} ); > my $isbn = '0590353403'; > my $title = 'Foundation'; > my $marc_record = MARC::Record->new; > my @fields = ( > MARC::Field->new( '003', 'AR-CdUBM' ), > MARC::Field->new( '008', '######suuuu####ag_||||__||||_0||_|_uuu|d' ), >- MARC::Field->new( '020', q{}, q{}, 'a' => $isbn ), >- MARC::Field->new( '245', q{}, q{}, 'a' => $title ), >+ MARC::Field->new( $isbn_field, q{}, q{}, $isbn_subfield => $isbn ), >+ MARC::Field->new( $title_field, q{}, q{}, $title_subfield => $title ), > ); > > $marc_record->insert_fields_ordered(@fields); >@@ -165,14 +166,18 @@ subtest 'Koha::Filter::MARC::ViewPolicy opac tests' => sub { > > plan tests => 102; > >+ $schema->storage->txn_begin(); > run_hiding_tests('opac'); >+ $schema->storage->txn_rollback(); > }; > > subtest 'Koha::Filter::MARC::ViewPolicy intranet tests' => sub { > > plan tests => 102; > >+ $schema->storage->txn_begin(); > run_hiding_tests('intranet'); >+ $schema->storage->txn_rollback(); > }; > > 1; >-- >1.7.10.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 15870
:
48260
|
48261
|
48346
|
48628
|
48766
|
48767
|
48768
|
48769
|
48812
|
48813
|
48814
|
48815
|
49013
|
49035
|
49534
|
49535
|
49536
|
49537
|
49538