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

(-)a/Koha/Cache.pm (+1 lines)
Lines 281-286 sub set_in_cache { Link Here
281
    $expiry //= $self->{timeout};
281
    $expiry //= $self->{timeout};
282
    my $set_sub = $self->{ref($self->{$cache}) . "_set"};
282
    my $set_sub = $self->{ref($self->{$cache}) . "_set"};
283
283
284
    $value = clone $value;
284
    # Set in L1 cache
285
    # Set in L1 cache
285
    $L1_cache{ $key } = $value;
286
    $L1_cache{ $key } = $value;
286
287
(-)a/t/Cache.t (-2 / +3 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 38;
20
use Test::More tests => 39;
21
21
22
my $destructorcount = 0;
22
my $destructorcount = 0;
23
23
Lines 196-201 SKIP: { Link Here
196
    $item_from_cache = $cache->get_from_cache('test_deep_copy_hash');
196
    $item_from_cache = $cache->get_from_cache('test_deep_copy_hash');
197
    %$item_from_cache = ( another => 'hashref' );
197
    %$item_from_cache = ( another => 'hashref' );
198
    is_deeply( $cache->get_from_cache('test_deep_copy_hash'), { a => 'hashref' }, 'A hash will be deep copied');
198
    is_deeply( $cache->get_from_cache('test_deep_copy_hash'), { a => 'hashref' }, 'A hash will be deep copied');
199
    %item = ( a_modified => 'hashref' );
200
    is_deeply( $cache->get_from_cache('test_deep_copy_hash'), { a => 'hashref' }, 'A hash will be deep copied when set in cache');
199
    $item_from_cache = $cache->get_from_cache('test_deep_copy_hash', { unsafe => 1});
201
    $item_from_cache = $cache->get_from_cache('test_deep_copy_hash', { unsafe => 1});
200
    %$item_from_cache = ( another => 'hashref' );
202
    %$item_from_cache = ( another => 'hashref' );
201
    is_deeply( $cache->get_from_cache('test_deep_copy_hash'), { another => 'hashref' }, 'A hash will not be deep copied if the unsafe flag is set');
203
    is_deeply( $cache->get_from_cache('test_deep_copy_hash'), { another => 'hashref' }, 'A hash will not be deep copied if the unsafe flag is set');
202
- 

Return to bug 16229