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

(-)a/Koha/Illrequest/Config.pm (-6 / +2 lines)
Lines 64-71 sub new { Link Here
64
    my $self  = {};
64
    my $self  = {};
65
65
66
    $self->{configuration} = _load_configuration(
66
    $self->{configuration} = _load_configuration(
67
        C4::Context->config("interlibrary_loans"),
67
        C4::Context->config("interlibrary_loans")
68
        C4::Context->preference("UnmediatedILL")
69
      );
68
      );
70
69
71
    bless $self, $class;
70
    bless $self, $class;
Lines 230-236 file to ensure we have only valid input there. Link Here
230
=cut
229
=cut
231
230
232
sub _load_configuration {
231
sub _load_configuration {
233
    my ( $xml_config, $unmediated ) = @_;
232
    my ( $xml_config ) = @_;
234
    my $xml_backend_dir = $xml_config->{backend_directory};
233
    my $xml_backend_dir = $xml_config->{backend_directory};
235
234
236
    # Default data structure to be returned
235
    # Default data structure to be returned
Lines 309-317 sub _load_configuration { Link Here
309
    # ILL Partners
308
    # ILL Partners
310
    $configuration->{partner_code} = $xml_config->{partner_code} || 'ILLLIBS';
309
    $configuration->{partner_code} = $xml_config->{partner_code} || 'ILLLIBS';
311
310
312
    die "No DEFAULT_FORMATS has been defined in koha-conf.xml, but UNMEDIATEDILL is active."
313
        if ( $unmediated && !$configuration->{default_formats}->{default} );
314
315
    return $configuration;
311
    return $configuration;
316
}
312
}
317
313
(-)a/t/db_dependent/Illrequest/Config.t (-3 lines)
Lines 43-49 subtest 'Basics' => sub { Link Here
43
43
44
    $schema->storage->txn_begin;
44
    $schema->storage->txn_begin;
45
45
46
    t::lib::Mocks::mock_preference("UnmediatedILL", 0);
47
    t::lib::Mocks::mock_config("interlibrary_loans", {});
46
    t::lib::Mocks::mock_config("interlibrary_loans", {});
48
47
49
    my $config = Koha::Illrequest::Config->new;
48
    my $config = Koha::Illrequest::Config->new;
Lines 415-421 subtest 'Final tests' => sub { Link Here
415
414
416
    $schema->storage->txn_begin;
415
    $schema->storage->txn_begin;
417
416
418
    t::lib::Mocks::mock_preference("UnmediatedILL", 0);
419
    t::lib::Mocks::mock_config("interlibrary_loans", {});
417
    t::lib::Mocks::mock_config("interlibrary_loans", {});
420
418
421
    my $config = Koha::Illrequest::Config->new;
419
    my $config = Koha::Illrequest::Config->new;
422
- 

Return to bug 7317