Bugzilla – Attachment 175287 Details for
Bug 37486
Selectively populate OAI-PMH set by set_id using build_oai_sets.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37486: Tidy
Bug-37486-Tidy.patch (text/plain), 2.86 KB, created by
David Cook
on 2024-12-09 05:13:05 UTC
(
hide
)
Description:
Bug 37486: Tidy
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-12-09 05:13:05 UTC
Size:
2.86 KB
patch
obsolete
>From a0f4a2873e977825dc693dcca04cd750bf84c796 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 9 Dec 2024 05:09:47 +0000 >Subject: [PATCH] Bug 37486: Tidy > >--- > C4/OAI/Sets.pm | 20 ++++++++++---------- > misc/migration_tools/build_oai_sets.pl | 4 ++-- > t/db_dependent/OAI/Sets.t | 2 +- > 3 files changed, 13 insertions(+), 13 deletions(-) > >diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm >index ff68fa81b8..f7937b6067 100644 >--- a/C4/OAI/Sets.pm >+++ b/C4/OAI/Sets.pm >@@ -69,12 +69,12 @@ The hash references looks like this: > > sub GetOAISets { > my ($args) = @_; >- my $where = ''; >- my @bind = (); >- if ($args){ >- if ($args->{set_id}){ >+ my $where = ''; >+ my @bind = (); >+ if ($args) { >+ if ( $args->{set_id} ) { > $where = ' WHERE id = ? '; >- push(@bind,$args->{set_id}); >+ push( @bind, $args->{set_id} ); > } > } > my $dbh = C4::Context->dbh; >@@ -341,12 +341,12 @@ The first hashref keys are the sets IDs, so it looks like this: > > sub GetOAISetsMappings { > my ($args) = @_; >- my $where = ''; >- my @bind = (); >- if ($args){ >- if ($args->{set_id}){ >+ my $where = ''; >+ my @bind = (); >+ if ($args) { >+ if ( $args->{set_id} ) { > $where = " WHERE set_id = ? "; >- push(@bind,$args->{set_id}); >+ push( @bind, $args->{set_id} ); > } > } > my $dbh = C4::Context->dbh; >diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl >index 8e276364f3..f84b9d5144 100755 >--- a/misc/migration_tools/build_oai_sets.pl >+++ b/misc/migration_tools/build_oai_sets.pl >@@ -59,7 +59,7 @@ use Koha::Biblio::Metadata; > > my %opts; > $Getopt::Std::STANDARD_HELP_VERSION = 1; >-my $go = getopts('vo:l:ihrs:', \%opts); >+my $go = getopts( 'vo:l:ihrs:', \%opts ); > > if(!$go or $opts{h}){ > &print_usage; >@@ -74,7 +74,7 @@ my $reset = $opts{r}; > my $set = $opts{s}; > > my $selective_set = {}; >-if ($set){ >+if ($set) { > $selective_set->{set_id} = $set; > } > >diff --git a/t/db_dependent/OAI/Sets.t b/t/db_dependent/OAI/Sets.t >index 15a18f0b3d..2ba3b3634a 100755 >--- a/t/db_dependent/OAI/Sets.t >+++ b/t/db_dependent/OAI/Sets.t >@@ -335,7 +335,7 @@ is ($mappings->{$set2_id}->[0]->{marcvalue}, 'myOtherMarcValue', 'marcvalue fiel > > my $selective_mappings = GetOAISetsMappings( { set_id => $set1_id } ); > is( scalar keys %$selective_mappings, 1, 'Selective mappings only returns mappings for selected set_id' ); >-is_deeply($selective_mappings->{$set1_id},$mappings->{$set1_id}, 'Correct mapping returned for selective mappings'); >+is_deeply( $selective_mappings->{$set1_id}, $mappings->{$set1_id}, 'Correct mapping returned for selective mappings' ); > > # ---------- Testing GetOAISetMappings ---------- > ok (!defined(GetOAISetMappings), 'GetOAISetMappings without argument is undef'); >-- >2.39.5
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 37486
:
175286
|
175287
|
176287
|
176288