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

(-)a/C4/Items.pm (-1 / +1 lines)
Lines 636-642 sub GetItemsForInventory { Link Here
636
            '+select' => [ 'marc_subfield_structures.kohafield', 'marc_subfield_structures.frameworkcode', 'me.authorised_value', 'me.lib' ],
636
            '+select' => [ 'marc_subfield_structures.kohafield', 'marc_subfield_structures.frameworkcode', 'me.authorised_value', 'me.lib' ],
637
            '+as'     => [ 'kohafield',                          'frameworkcode',                          'authorised_value',    'lib' ],
637
            '+as'     => [ 'kohafield',                          'frameworkcode',                          'authorised_value',    'lib' ],
638
        }
638
        }
639
    );
639
    )->as_list;
640
640
641
    my $avmapping = { map { $_->get_column('kohafield') . ',' . $_->get_column('frameworkcode') . ',' . $_->get_column('authorised_value') => $_->get_column('lib') } @avs };
641
    my $avmapping = { map { $_->get_column('kohafield') . ',' . $_->get_column('frameworkcode') . ',' . $_->get_column('authorised_value') => $_->get_column('lib') } @avs };
642
642
(-)a/Koha/ItemType.pm (-1 / +1 lines)
Lines 80-86 sub translated_descriptions { Link Here
80
        {   entity => 'itemtypes',
80
        {   entity => 'itemtypes',
81
            code   => $self->itemtype,
81
            code   => $self->itemtype,
82
        }
82
        }
83
    );
83
    )->as_list;
84
    return [ map {
84
    return [ map {
85
        {
85
        {
86
            lang => $_->lang,
86
            lang => $_->lang,
(-)a/reports/guided_reports.pl (-2 / +2 lines)
Lines 749-755 elsif ($phase eq 'Run this report'){ Link Here
749
                        }
749
                        }
750
                    }
750
                    }
751
                    elsif ( $authorised_value eq "biblio_framework" ) {
751
                    elsif ( $authorised_value eq "biblio_framework" ) {
752
                        my @frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
752
                        my @frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] })->as_list;
753
                        my $default_source = '';
753
                        my $default_source = '';
754
                        push @authorised_values,$default_source;
754
                        push @authorised_values,$default_source;
755
                        $authorised_lib{$default_source} = 'Default';
755
                        $authorised_lib{$default_source} = 'Default';
Lines 769-775 elsif ($phase eq 'Run this report'){ Link Here
769
                        }
769
                        }
770
                    }
770
                    }
771
                    elsif ( $authorised_value eq "categorycode" ) {
771
                    elsif ( $authorised_value eq "categorycode" ) {
772
                        my @patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description']});
772
                        my @patron_categories = Koha::Patron::Categories->search({}, { order_by => ['description']})->as_list;
773
                        %authorised_lib = map { $_->categorycode => $_->description } @patron_categories;
773
                        %authorised_lib = map { $_->categorycode => $_->description } @patron_categories;
774
                        push @authorised_values, $_->categorycode for @patron_categories;
774
                        push @authorised_values, $_->categorycode for @patron_categories;
775
                    }
775
                    }
(-)a/t/db_dependent/Acquisition.t (-5 / +5 lines)
Lines 911-922 subtest 'Acquisition logging' => sub { Link Here
911
911
912
    Koha::ActionLogs->delete;
912
    Koha::ActionLogs->delete;
913
    my $basketno = NewBasket( $booksellerid, 1 );
913
    my $basketno = NewBasket( $booksellerid, 1 );
914
    my @create_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'ADD_BASKET', object => $basketno });
914
    my @create_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'ADD_BASKET', object => $basketno })->as_list;
915
    is (scalar @create_logs, 1, 'Basket creation is logged');
915
    is (scalar @create_logs, 1, 'Basket creation is logged');
916
916
917
    Koha::ActionLogs->delete;
917
    Koha::ActionLogs->delete;
918
    C4::Acquisition::ReopenBasket($basketno);
918
    C4::Acquisition::ReopenBasket($basketno);
919
    my @reopen_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'REOPEN_BASKET', object => $basketno });
919
    my @reopen_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'REOPEN_BASKET', object => $basketno })->as_list;
920
    is (scalar @reopen_logs, 1, 'Basket reopen is logged');
920
    is (scalar @reopen_logs, 1, 'Basket reopen is logged');
921
921
922
    Koha::ActionLogs->delete;
922
    Koha::ActionLogs->delete;
Lines 924-940 subtest 'Acquisition logging' => sub { Link Here
924
        basketno => $basketno,
924
        basketno => $basketno,
925
        booksellerid => $booksellerid
925
        booksellerid => $booksellerid
926
    });
926
    });
927
    my @mod_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET', object => $basketno });
927
    my @mod_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET', object => $basketno })->as_list;
928
    is (scalar @mod_logs, 1, 'Basket modify is logged');
928
    is (scalar @mod_logs, 1, 'Basket modify is logged');
929
929
930
    Koha::ActionLogs->delete;
930
    Koha::ActionLogs->delete;
931
    C4::Acquisition::ModBasketHeader($basketno,"Test","","","",$booksellerid);
931
    C4::Acquisition::ModBasketHeader($basketno,"Test","","","",$booksellerid);
932
    my @mod_header_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_HEADER', object => $basketno });
932
    my @mod_header_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_HEADER', object => $basketno })->as_list;
933
    is (scalar @mod_header_logs, 1, 'Basket header modify is logged');
933
    is (scalar @mod_header_logs, 1, 'Basket header modify is logged');
934
934
935
    Koha::ActionLogs->delete;
935
    Koha::ActionLogs->delete;
936
    C4::Acquisition::ModBasketUsers($basketno,(1));
936
    C4::Acquisition::ModBasketUsers($basketno,(1));
937
    my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno });
937
    my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno })->as_list;
938
    is (scalar @mod_users_logs, 1, 'Basket users modify is logged');
938
    is (scalar @mod_users_logs, 1, 'Basket users modify is logged');
939
939
940
    t::lib::Mocks::mock_preference('AcquisitionLog', 0);
940
    t::lib::Mocks::mock_preference('AcquisitionLog', 0);
(-)a/t/db_dependent/Koha/Acquisition/Basket.t (-1 / +1 lines)
Lines 425-431 subtest 'close() tests' => sub { Link Here
425
        'Koha::Exceptions::Acquisition::Basket::AlreadyClosed',
425
        'Koha::Exceptions::Acquisition::Basket::AlreadyClosed',
426
        'Trying to close an already closed basket throws an exception';
426
        'Trying to close an already closed basket throws an exception';
427
427
428
    my @close_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'CLOSE_BASKET', object => $basket->id });
428
    my @close_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'CLOSE_BASKET', object => $basket->id })->as_list;
429
    is (scalar @close_logs, 1, 'Basket closure is logged');
429
    is (scalar @close_logs, 1, 'Basket closure is logged');
430
430
431
    $schema->storage->txn_rollback;
431
    $schema->storage->txn_rollback;
(-)a/t/db_dependent/Patron/HouseboundRoles.t (-1 / +1 lines)
Lines 42-48 is( Link Here
42
);
42
);
43
43
44
my @roles = Koha::Patron::HouseboundRoles
44
my @roles = Koha::Patron::HouseboundRoles
45
    ->search({ borrowernumber_id => $role->{borrowernumber_id} });
45
    ->search({ borrowernumber_id => $role->{borrowernumber_id} })->as_list;
46
my $found_role = shift @roles;
46
my $found_role = shift @roles;
47
is(
47
is(
48
    $found_role->borrowernumber_id,
48
    $found_role->borrowernumber_id,
(-)a/t/db_dependent/Patron/HouseboundVisits.t (-3 / +3 lines)
Lines 45-51 is( Link Here
45
45
46
# Does it work implicitly?
46
# Does it work implicitly?
47
my @visits = Koha::Patron::HouseboundVisits
47
my @visits = Koha::Patron::HouseboundVisits
48
    ->special_search({ borrowernumber => $visit->{borrowernumber} });
48
    ->special_search({ borrowernumber => $visit->{borrowernumber} })->as_list;
49
my $found_visit = shift @visits;
49
my $found_visit = shift @visits;
50
is(
50
is(
51
    $found_visit->borrowernumber,
51
    $found_visit->borrowernumber,
Lines 55-61 is( Link Here
55
55
56
# Does it work Explicitly?
56
# Does it work Explicitly?
57
@visits = Koha::Patron::HouseboundVisits
57
@visits = Koha::Patron::HouseboundVisits
58
    ->special_search({ 'me.borrowernumber' => $visit->{borrowernumber} });
58
    ->special_search({ 'me.borrowernumber' => $visit->{borrowernumber} })->as_list;
59
$found_visit = shift @visits;
59
$found_visit = shift @visits;
60
is(
60
is(
61
    $found_visit->borrowernumber,
61
    $found_visit->borrowernumber,
Lines 65-71 is( Link Here
65
65
66
# Does it work without prefetcing?
66
# Does it work without prefetcing?
67
@visits = Koha::Patron::HouseboundVisits
67
@visits = Koha::Patron::HouseboundVisits
68
    ->special_search({ borrowernumber => $visit->{borrowernumber} }, { prefetch => [] });
68
    ->special_search({ borrowernumber => $visit->{borrowernumber} }, { prefetch => [] })->as_list;
69
$found_visit = shift @visits;
69
$found_visit = shift @visits;
70
is(
70
is(
71
    $found_visit->borrowernumber,
71
    $found_visit->borrowernumber,
(-)a/t/db_dependent/Template/Plugin/Categories.t (-2 / +2 lines)
Lines 36-46 my $nb_categories = Koha::Patron::Categories->count; Link Here
36
36
37
# Create sample categories
37
# Create sample categories
38
my $category_1 = $builder->build( { source => 'Category' } );
38
my $category_1 = $builder->build( { source => 'Category' } );
39
my @categories = Koha::Template::Plugin::Categories->new->all;
39
my @categories = Koha::Template::Plugin::Categories->new->all->as_list;
40
is( scalar(@categories), 1 + $nb_categories, '->all returns all defined categories' );
40
is( scalar(@categories), 1 + $nb_categories, '->all returns all defined categories' );
41
41
42
my $category_2 = $builder->build( { source => 'Category' } );
42
my $category_2 = $builder->build( { source => 'Category' } );
43
@categories = Koha::Template::Plugin::Categories->new->all;
43
@categories = Koha::Template::Plugin::Categories->new->all->as_list;
44
is( scalar(@categories), 2 + $nb_categories, '->all returns all defined categories' );
44
is( scalar(@categories), 2 + $nb_categories, '->all returns all defined categories' );
45
45
46
is( Koha::Template::Plugin::Categories->GetName(
46
is( Koha::Template::Plugin::Categories->GetName(
(-)a/t/db_dependent/Utils/Datatables_Virtualshelves.t (-2 / +1 lines)
Lines 38-44 my $dbh = C4::Context->dbh; Link Here
38
$dbh->do(q|DELETE FROM virtualshelves|);
38
$dbh->do(q|DELETE FROM virtualshelves|);
39
39
40
# Pick a categorycode from the DB
40
# Pick a categorycode from the DB
41
my @categories   = Koha::Patron::Categories->search_with_library_limits;
41
my @categories   = Koha::Patron::Categories->search_with_library_limits->as_list;
42
my $categorycode = $categories[0]->categorycode;
42
my $categorycode = $categories[0]->categorycode;
43
my $branchcode   = "ABC";
43
my $branchcode   = "ABC";
44
my $branch_data = {
44
my $branch_data = {
45
- 

Return to bug 29844