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

(-)a/C4/OAI/Sets.pm (-2 / +2 lines)
Lines 525-531 sub CalcOAISetsBiblio { Link Here
525
    };
525
    };
526
    ModOAISetsBiblios($oai_sets_biblios);
526
    ModOAISetsBiblios($oai_sets_biblios);
527
527
528
ModOAISetsBiblios truncate oai_sets_biblios table and call AddOAISetsBiblios.
528
ModOAISetsBiblios deletes all records from oai_sets_biblios table and calls AddOAISetsBiblios.
529
This table is then used in opac/oai.pl.
529
This table is then used in opac/oai.pl.
530
530
531
=cut
531
=cut
Lines 537-543 sub ModOAISetsBiblios { Link Here
537
537
538
    my $dbh = C4::Context->dbh;
538
    my $dbh = C4::Context->dbh;
539
    my $query = qq{
539
    my $query = qq{
540
        TRUNCATE TABLE oai_sets_biblios
540
        DELETE FROM oai_sets_biblios
541
    };
541
    };
542
    my $sth = $dbh->prepare($query);
542
    my $sth = $dbh->prepare($query);
543
    $sth->execute;
543
    $sth->execute;
(-)a/t/db_dependent/OAI/Sets.t (-31 / +10 lines)
Lines 17-56 Link Here
17
# with Koha; if not, see <http://www.gnu.org/licenses>.
17
# with Koha; if not, see <http://www.gnu.org/licenses>.
18
18
19
use Modern::Perl;
19
use Modern::Perl;
20
use C4::Context;
20
21
use Test::More tests => 148;
21
use Test::More tests => 144;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
use MARC::Record;
24
25
26
use Koha::Database;
27
use C4::Biblio;
28
use C4::OAI::Sets;
25
29
26
BEGIN {
30
my $schema  = Koha::Database->new->schema;
27
    use_ok('C4::OAI::Sets');
31
$schema->storage->txn_begin;
28
    use_ok('MARC::Record');
29
    use_ok('C4::Biblio');
30
}
31
can_ok(
32
    'C4::OAI::Sets', qw(
33
        GetOAISets
34
        GetOAISet
35
        GetOAISetBySpec
36
        ModOAISet
37
        DelOAISet
38
        AddOAISet
39
        GetOAISetsMappings
40
        GetOAISetMappings
41
        ModOAISetMappings
42
        GetOAISetsBiblio
43
        DelOAISetsBiblio
44
        CalcOAISetsBiblio
45
        ModOAISetsBiblios
46
        UpdateOAISetsBiblio
47
        AddOAISetsBiblios )
48
);
49
50
51
my $dbh = C4::Context->dbh;
32
my $dbh = C4::Context->dbh;
52
$dbh->{AutoCommit} = 0;
33
53
$dbh->{RaiseError} = 1;
54
$dbh->do('DELETE FROM oai_sets');
34
$dbh->do('DELETE FROM oai_sets');
55
$dbh->do('DELETE FROM oai_sets_descriptions');
35
$dbh->do('DELETE FROM oai_sets_descriptions');
56
$dbh->do('DELETE FROM oai_sets_mappings');
36
$dbh->do('DELETE FROM oai_sets_mappings');
Lines 632-635 sub create_helper_biblio { Link Here
632
    return $biblionumber;
612
    return $biblionumber;
633
}
613
}
634
614
635
$dbh->rollback;
615
$schema->storage->txn_rollback;
636
- 

Return to bug 18601