View | Details | Raw Unified | Return to bug 37486
Collapse All | Expand All

(-)a/C4/OAI/Sets.pm (-10 / +10 lines)
Lines 69-80 The hash references looks like this: Link Here
69
69
70
sub GetOAISets {
70
sub GetOAISets {
71
    my ($args) = @_;
71
    my ($args) = @_;
72
    my $where = '';
72
    my $where  = '';
73
    my @bind = ();
73
    my @bind   = ();
74
    if ($args){
74
    if ($args) {
75
        if ($args->{set_id}){
75
        if ( $args->{set_id} ) {
76
            $where = ' WHERE id = ? ';
76
            $where = ' WHERE id = ? ';
77
            push(@bind,$args->{set_id});
77
            push( @bind, $args->{set_id} );
78
        }
78
        }
79
    }
79
    }
80
    my $dbh = C4::Context->dbh;
80
    my $dbh = C4::Context->dbh;
Lines 341-352 The first hashref keys are the sets IDs, so it looks like this: Link Here
341
341
342
sub GetOAISetsMappings {
342
sub GetOAISetsMappings {
343
    my ($args) = @_;
343
    my ($args) = @_;
344
    my $where = '';
344
    my $where  = '';
345
    my @bind = ();
345
    my @bind   = ();
346
    if ($args){
346
    if ($args) {
347
        if ($args->{set_id}){
347
        if ( $args->{set_id} ) {
348
            $where = " WHERE set_id = ? ";
348
            $where = " WHERE set_id = ? ";
349
            push(@bind,$args->{set_id});
349
            push( @bind, $args->{set_id} );
350
        }
350
        }
351
    }
351
    }
352
    my $dbh = C4::Context->dbh;
352
    my $dbh = C4::Context->dbh;
(-)a/misc/migration_tools/build_oai_sets.pl (-2 / +2 lines)
Lines 59-65 use Koha::Biblio::Metadata; Link Here
59
59
60
my %opts;
60
my %opts;
61
$Getopt::Std::STANDARD_HELP_VERSION = 1;
61
$Getopt::Std::STANDARD_HELP_VERSION = 1;
62
my $go = getopts('vo:l:ihrs:', \%opts);
62
my $go = getopts( 'vo:l:ihrs:', \%opts );
63
63
64
if(!$go or $opts{h}){
64
if(!$go or $opts{h}){
65
    &print_usage;
65
    &print_usage;
Lines 74-80 my $reset = $opts{r}; Link Here
74
my $set = $opts{s};
74
my $set = $opts{s};
75
75
76
my $selective_set = {};
76
my $selective_set = {};
77
if ($set){
77
if ($set) {
78
    $selective_set->{set_id} = $set;
78
    $selective_set->{set_id} = $set;
79
}
79
}
80
80
(-)a/t/db_dependent/OAI/Sets.t (-2 / +1 lines)
Lines 335-341 is ($mappings->{$set2_id}->[0]->{marcvalue}, 'myOtherMarcValue', 'marcvalue fiel Link Here
335
335
336
my $selective_mappings = GetOAISetsMappings( { set_id => $set1_id } );
336
my $selective_mappings = GetOAISetsMappings( { set_id => $set1_id } );
337
is( scalar keys %$selective_mappings, 1, 'Selective mappings only returns mappings for selected set_id' );
337
is( scalar keys %$selective_mappings, 1, 'Selective mappings only returns mappings for selected set_id' );
338
is_deeply($selective_mappings->{$set1_id},$mappings->{$set1_id}, 'Correct mapping returned for selective mappings');
338
is_deeply( $selective_mappings->{$set1_id}, $mappings->{$set1_id}, 'Correct mapping returned for selective mappings' );
339
339
340
# ---------- Testing GetOAISetMappings ----------
340
# ---------- Testing GetOAISetMappings ----------
341
ok (!defined(GetOAISetMappings), 'GetOAISetMappings without argument is undef');
341
ok (!defined(GetOAISetMappings), 'GetOAISetMappings without argument is undef');
342
- 

Return to bug 37486