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

(-)a/Koha/Object.pm (-1 / +1 lines)
Lines 436-442 sub prefetch_whitelist { Link Here
436
            my $result_class = $relations->{$key}->{class};
436
            my $result_class = $relations->{$key}->{class};
437
            my $obj = $result_class->new;
437
            my $obj = $result_class->new;
438
            try {
438
            try {
439
                $whitelist->{$key} = $obj->koha_object_class;
439
                $whitelist->{$key} = Koha::Object::_get_object_class( $obj->result_class );
440
            } catch {
440
            } catch {
441
                $whitelist->{$key} = undef;
441
                $whitelist->{$key} = undef;
442
            }
442
            }
(-)a/t/db_dependent/Koha/Object.t (-2 / +8 lines)
Lines 809-815 subtest 'get_from_storage' => sub { Link Here
809
809
810
subtest 'prefetch_whitelist() tests' => sub {
810
subtest 'prefetch_whitelist() tests' => sub {
811
811
812
    plan tests => 2;
812
    plan tests => 3;
813
813
814
    $schema->storage->txn_begin;
814
    $schema->storage->txn_begin;
815
815
Lines 824-830 subtest 'prefetch_whitelist() tests' => sub { Link Here
824
    is(
824
    is(
825
        $prefetch_whitelist->{orders},
825
        $prefetch_whitelist->{orders},
826
        'Koha::Acquisition::Order',
826
        'Koha::Acquisition::Order',
827
        'Guessed the object class correctly'
827
        'Guessed the non-standard object class correctly'
828
    );
829
830
    is(
831
        $prefetch_whitelist->{items},
832
        'Koha::Item',
833
        'Guessed the standard object class correctly'
828
    );
834
    );
829
835
830
    $schema->storage->txn_rollback;
836
    $schema->storage->txn_rollback;
(-)a/t/db_dependent/Koha/Objects.t (-3 / +8 lines)
Lines 773-779 subtest "from_api_mapping() tests" => sub { Link Here
773
773
774
subtest 'prefetch_whitelist() tests' => sub {
774
subtest 'prefetch_whitelist() tests' => sub {
775
775
776
    plan tests => 2;
776
    plan tests => 3;
777
777
778
    $schema->storage->txn_begin;
778
    $schema->storage->txn_begin;
779
779
Lines 788-794 subtest 'prefetch_whitelist() tests' => sub { Link Here
788
    is(
788
    is(
789
        $prefetch_whitelist->{orders},
789
        $prefetch_whitelist->{orders},
790
        'Koha::Acquisition::Order',
790
        'Koha::Acquisition::Order',
791
        'Guessed the object class correctly'
791
        'Guessed the non-standard object class correctly'
792
    );
793
794
    is(
795
        $prefetch_whitelist->{items},
796
        'Koha::Item',
797
        'Guessed the standard object class correctly'
792
    );
798
    );
793
799
794
    $schema->storage->txn_rollback;
800
    $schema->storage->txn_rollback;
795
- 

Return to bug 25044