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

(-)a/Koha/LibraryCategory.pm (-1 / +1 lines)
Lines 41-47 sub new { Link Here
41
    return $self->SUPER::new( $params );
41
    return $self->SUPER::new( $params );
42
}
42
}
43
43
44
sub branchcodes{
44
sub libraries{
45
    my ( $self, $params ) = @_;
45
    my ( $self, $params ) = @_;
46
    # TODO  This should return Koha::Libraries
46
    # TODO  This should return Koha::Libraries
47
    return $self->{_result}->branchcodes( $params );
47
    return $self->{_result}->branchcodes( $params );
(-)a/admin/branches.pl (-1 / +1 lines)
Lines 194-200 if ( $op eq 'add_form' ) { Link Here
194
    $op = 'list';
194
    $op = 'list';
195
} elsif ( $op eq 'delete_confirm_category' ) {
195
} elsif ( $op eq 'delete_confirm_category' ) {
196
    my $category = Koha::LibraryCategories->find($categorycode);
196
    my $category = Koha::LibraryCategories->find($categorycode);
197
    if ( my $libraries_count = scalar( $category->branchcodes ) ) {
197
    if ( my $libraries_count = scalar( $category->libraries ) ) {
198
        push @messages,
198
        push @messages,
199
          { type => 'error',
199
          { type => 'error',
200
            code => 'cannot_delete_category',
200
            code => 'cannot_delete_category',
(-)a/t/db_dependent/Koha/Libraries.t (-2 / +1 lines)
Lines 77-83 $retrieved_library_1->update_categories( [ $new_category_2, $new_category_3 ] ); Link Here
77
is( Koha::Libraries->find( $new_library_1->branchcode )->get_categories->count, 2, '2 libraries should have been linked to the category 2' );
77
is( Koha::Libraries->find( $new_library_1->branchcode )->get_categories->count, 2, '2 libraries should have been linked to the category 2' );
78
78
79
my $retrieved_category_2 = Koha::LibraryCategories->find( $new_category_2->categorycode );
79
my $retrieved_category_2 = Koha::LibraryCategories->find( $new_category_2->categorycode );
80
is( $retrieved_category_2->branchcodes->count, 2, '2 libraries should have been linked to the category_2' );
80
is( $retrieved_category_2->libraries->count, 2, '2 libraries should have been linked to the category_2' );
81
is( $retrieved_category_2->categorycode, uc('my_cc_2'), 'The Koha::LibraryCategory constructor should have upercased the categorycode' );
81
is( $retrieved_category_2->categorycode, uc('my_cc_2'), 'The Koha::LibraryCategory constructor should have upercased the categorycode' );
82
82
83
$retrieved_library_1->delete;
83
$retrieved_library_1->delete;
84
- 

Return to bug 15629