Bug 16221: follow-up for changes made by bug 16229
[koha-ffzg.git] / Koha / Cache.pm
index 80a6d95..7793f06 100644 (file)
@@ -38,7 +38,7 @@ The first, traditional OO interface provides the following functions:
 use strict;
 use warnings;
 use Carp;
-use Clone qw( clone );
+use Storable qw(dclone);
 use Module::Load::Conditional qw(can_load);
 use Koha::Cache::Object;
 
@@ -269,7 +269,7 @@ sub set_in_cache {
     my $set_sub = $self->{ref($self->{$cache}) . "_set"};
 
     # Deep copy if it's not a scalar and unsafe is not passed
-    $value = clone( $value ) if ref($value) and not $unsafe;
+    $value = dclone( $value ) if ref($value) and not $unsafe;
 
     # Set in L1 cache
     $L1_cache{ $key } = $value;
@@ -328,7 +328,7 @@ sub get_from_cache {
         # Or if we do not need to deep copy
         return $L1_cache{$key}
             if not ref $L1_cache{$key} or $unsafe;
-        return clone $L1_cache{$key};
+        return dclone $L1_cache{$key};
     }
 
     my $get_sub = $self->{ref($self->{$cache}) . "_get"};
@@ -338,7 +338,7 @@ sub get_from_cache {
     # Otherwise the L1 cache won't ever be populated
     $L1_cache{$key} = $value;
 
-    $value = clone $value if ref $L1_cache{$key} and not $unsafe;
+    $value = dclone $value if ref $L1_cache{$key} and not $unsafe;
 
     return $value;
 }