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

(-)a/C4/Calendar.pm (-14 / +14 lines)
Lines 277-284 sub insert_single_holiday { Link Here
277
277
278
    # changed the 'single_holidays' table, lets force/reset its cache
278
    # changed the 'single_holidays' table, lets force/reset its cache
279
    my $cache = Koha::Caches->get_instance();
279
    my $cache = Koha::Caches->get_instance();
280
    $cache->clear_from_cache( 'single_holidays') ;
280
    my $key   = $self->{branchcode} . "_holidays";
281
    $cache->clear_from_cache( 'exception_holidays') ;
281
    $cache->clear_from_cache($key);
282
282
283
    return $self;
283
    return $self;
284
284
Lines 322-329 sub insert_exception_holiday { Link Here
322
322
323
    # changed the 'single_holidays' table, lets force/reset its cache
323
    # changed the 'single_holidays' table, lets force/reset its cache
324
    my $cache = Koha::Caches->get_instance();
324
    my $cache = Koha::Caches->get_instance();
325
    $cache->clear_from_cache( 'single_holidays') ;
325
    my $key   = $self->{branchcode} . "_holidays";
326
    $cache->clear_from_cache( 'exception_holidays') ;
326
    $cache->clear_from_cache($key);
327
327
328
    return $self;
328
    return $self;
329
}
329
}
Lines 423-430 UPDATE special_holidays SET title = ?, description = ? Link Here
423
423
424
    # changed the 'single_holidays' table, lets force/reset its cache
424
    # changed the 'single_holidays' table, lets force/reset its cache
425
    my $cache = Koha::Caches->get_instance();
425
    my $cache = Koha::Caches->get_instance();
426
    $cache->clear_from_cache( 'single_holidays') ;
426
    my $key   = $self->{branchcode} . "_holidays";
427
    $cache->clear_from_cache( 'exception_holidays') ;
427
    $cache->clear_from_cache($key);
428
428
429
    return $self;
429
    return $self;
430
}
430
}
Lines 466-473 UPDATE special_holidays SET title = ?, description = ? Link Here
466
466
467
    # changed the 'single_holidays' table, lets force/reset its cache
467
    # changed the 'single_holidays' table, lets force/reset its cache
468
    my $cache = Koha::Caches->get_instance();
468
    my $cache = Koha::Caches->get_instance();
469
    $cache->clear_from_cache( 'single_holidays') ;
469
    my $key   = $self->{branchcode} . "_holidays";
470
    $cache->clear_from_cache( 'exception_holidays') ;
470
    $cache->clear_from_cache($key);
471
471
472
    return $self;
472
    return $self;
473
}
473
}
Lines 547-554 sub delete_holiday { Link Here
547
547
548
    # changed the 'single_holidays' table, lets force/reset its cache
548
    # changed the 'single_holidays' table, lets force/reset its cache
549
    my $cache = Koha::Caches->get_instance();
549
    my $cache = Koha::Caches->get_instance();
550
    $cache->clear_from_cache( 'single_holidays') ;
550
    my $key   = $self->{branchcode} . "_holidays";
551
    $cache->clear_from_cache( 'exception_holidays') ;
551
    $cache->clear_from_cache($key);
552
552
553
    return $self;
553
    return $self;
554
}
554
}
Lines 578-585 sub delete_holiday_range { Link Here
578
578
579
    # changed the 'single_holidays' table, lets force/reset its cache
579
    # changed the 'single_holidays' table, lets force/reset its cache
580
    my $cache = Koha::Caches->get_instance();
580
    my $cache = Koha::Caches->get_instance();
581
    $cache->clear_from_cache( 'single_holidays') ;
581
    my $key   = $self->{branchcode} . "_holidays";
582
    $cache->clear_from_cache( 'exception_holidays') ;
582
    $cache->clear_from_cache($key);
583
583
584
}
584
}
585
585
Lines 632-639 sub delete_exception_holiday_range { Link Here
632
632
633
    # changed the 'single_holidays' table, lets force/reset its cache
633
    # changed the 'single_holidays' table, lets force/reset its cache
634
    my $cache = Koha::Caches->get_instance();
634
    my $cache = Koha::Caches->get_instance();
635
    $cache->clear_from_cache( 'single_holidays') ;
635
    my $key   = $self->{branchcode} . "_holidays";
636
    $cache->clear_from_cache( 'exception_holidays') ;
636
    $cache->clear_from_cache($key);
637
}
637
}
638
638
639
=head2 isHoliday
639
=head2 isHoliday
(-)a/t/Calendar.t (-4 / +4 lines)
Lines 77-84 fixtures_ok [ Link Here
77
], "add fixtures";
77
], "add fixtures";
78
78
79
my $cache = Koha::Caches->get_instance();
79
my $cache = Koha::Caches->get_instance();
80
$cache->clear_from_cache( 'single_holidays' ) ;
80
$cache->clear_from_cache('MPL_holidays');
81
$cache->clear_from_cache( 'exception_holidays' ) ;
81
$cache->clear_from_cache('CPL_holidays');
82
82
83
# 'MPL' branch is arbitrary, is not used at all but is needed for initialization
83
# 'MPL' branch is arbitrary, is not used at all but is needed for initialization
84
my $cal = Koha::Calendar->new( branchcode => 'MPL' );
84
my $cal = Koha::Calendar->new( branchcode => 'MPL' );
Lines 310-315 subtest 'days_mode parameter' => sub { Link Here
310
};
310
};
311
311
312
END {
312
END {
313
    $cache->clear_from_cache( 'single_holidays' ) ;
313
    $cache->clear_from_cache('MPL_holidays');
314
    $cache->clear_from_cache( 'exception_holidays' ) ;
314
    $cache->clear_from_cache('CPL_holidays');
315
};
315
};
(-)a/t/db_dependent/Circulation.t (-2 / +10 lines)
Lines 110-116 $mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); Link Here
110
my $cache = Koha::Caches->get_instance();
110
my $cache = Koha::Caches->get_instance();
111
$dbh->do(q|DELETE FROM special_holidays|);
111
$dbh->do(q|DELETE FROM special_holidays|);
112
$dbh->do(q|DELETE FROM repeatable_holidays|);
112
$dbh->do(q|DELETE FROM repeatable_holidays|);
113
$cache->clear_from_cache('single_holidays');
113
my $branches = Koha::Libraries->search();
114
for my $branch ( $branches->next ) {
115
    my $key = $branch->branchcode . "_holidays";
116
    $cache->clear_from_cache($key);
117
}
114
118
115
# Start with a clean slate
119
# Start with a clean slate
116
$dbh->do('DELETE FROM issues');
120
$dbh->do('DELETE FROM issues');
Lines 3928-3931 subtest 'Filling a hold should cancel existing transfer' => sub { Link Here
3928
3932
3929
$schema->storage->txn_rollback;
3933
$schema->storage->txn_rollback;
3930
C4::Context->clear_syspref_cache();
3934
C4::Context->clear_syspref_cache();
3931
$cache->clear_from_cache('single_holidays');
3935
$branches = Koha::Libraries->search();
3936
for my $branch ( $branches->next ) {
3937
    my $key = $branch->branchcode . "_holidays";
3938
    $cache->clear_from_cache($key);
3939
}
(-)a/t/db_dependent/Circulation/CalcDateDue.t (-4 / +4 lines)
Lines 43-50 Koha::CirculationRules->set_rules( Link Here
43
t::lib::Mocks::mock_preference('ReturnBeforeExpiry', 1);
43
t::lib::Mocks::mock_preference('ReturnBeforeExpiry', 1);
44
t::lib::Mocks::mock_preference('useDaysMode', 'Days');
44
t::lib::Mocks::mock_preference('useDaysMode', 'Days');
45
45
46
my $cache           = Koha::Caches->get_instance();
46
my $cache = Koha::Caches->get_instance();
47
$cache->clear_from_cache('single_holidays');
47
my $key   = $branchcode . "_holidays";
48
$cache->clear_from_cache($key);
48
49
49
my $dateexpiry = '2013-01-01';
50
my $dateexpiry = '2013-01-01';
50
51
Lines 302-307 $calendar->delete_holiday( Link Here
302
    weekday => 6
303
    weekday => 6
303
);
304
);
304
305
305
306
$cache->clear_from_cache($key);
306
$cache->clear_from_cache('single_holidays');
307
$schema->storage->txn_rollback;
307
$schema->storage->txn_rollback;
(-)a/tools/newHolidays.pl (-4 lines)
Lines 143-149 sub add_holiday { Link Here
143
            }
143
            }
144
        }
144
        }
145
    }
145
    }
146
    # we updated the single_holidays table, so wipe its cache
147
    my $cache = Koha::Caches->get_instance();
148
    $cache->clear_from_cache( 'single_holidays') ;
149
}
146
}
150
- 

Return to bug 25723