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

(-)a/Koha/Patron.pm (-5 / +7 lines)
Lines 778-793 sub libraries_where_can_see_patrons { Link Here
778
            )
778
            )
779
          )
779
          )
780
        {
780
        {
781
            my $library_groups = $self->library->library_groups;
781
            my $library_groups = $self->library->library_groups({ ft_hide_patron_info => 1 });
782
            if ( $library_groups->count )
782
            if ( $library_groups->count )
783
            {
783
            {
784
                while ( my $library_group = $library_groups->next ) {
784
                while ( my $library_group = $library_groups->next ) {
785
                    push @restricted_branchcodes, $library_group->parent->children->get_column('branchcode');
785
                    my $parent = $library_group->parent;
786
                    if ( $parent->has_child( $self->branchcode ) ) {
787
                        push @restricted_branchcodes, $parent->children->get_column('branchcode');
788
                    }
786
                }
789
                }
787
            }
790
            }
788
            else {
791
789
                push @restricted_branchcodes, $self->branchcode;
792
            @restricted_branchcodes = ( $self->branchcode ) unless @restricted_branchcodes;
790
            }
791
        }
793
        }
792
    }
794
    }
793
795
(-)a/t/db_dependent/Koha/Patrons.t (-4 / +3 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 23;
22
use Test::More tests => 24;
23
use Test::Warn;
23
use Test::Warn;
24
use Time::Fake;
24
use Time::Fake;
25
use DateTime;
25
use DateTime;
Lines 947-954 subtest 'libraries_where_can_see_patrons + can_see_patron_infos + search_limited Link Here
947
    #   + library_12
947
    #   + library_12
948
    # group2
948
    # group2
949
    #   + library21
949
    #   + library21
950
    my $group_1 = Koha::Library::Group->new( { title => 'TEST Group 1' } )->store;
950
    my $group_1 = Koha::Library::Group->new( { title => 'TEST Group 1', ft_hide_patron_info => 1 } )->store;
951
    my $group_2 = Koha::Library::Group->new( { title => 'TEST Group 2' } )->store;
951
    my $group_2 = Koha::Library::Group->new( { title => 'TEST Group 2', ft_hide_patron_info => 1 } )->store;
952
    my $library_11 = $builder->build( { source => 'Branch' } );
952
    my $library_11 = $builder->build( { source => 'Branch' } );
953
    my $library_12 = $builder->build( { source => 'Branch' } );
953
    my $library_12 = $builder->build( { source => 'Branch' } );
954
    my $library_21 = $builder->build( { source => 'Branch' } );
954
    my $library_21 = $builder->build( { source => 'Branch' } );
955
- 

Return to bug 20133