[Rt-commit] rt branch, 4.4/config-clone-error, created. rt-4.4.2-99-g5fbb00f30

? sunnavy sunnavy at bestpractical.com
Fri Mar 9 15:47:40 EST 2018


The branch, 4.4/config-clone-error has been created
        at  5fbb00f30cdbed13c69886789945cfd06c6ba347 (commit)

- Log -----------------------------------------------------------------
commit 5fbb00f30cdbed13c69886789945cfd06c6ba347
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Mar 10 03:05:04 2018 +0800

    Switch to Clone::clone to copy config structures in Obfuscate callbacks
    
    Storable::dclone doesn't support CODE and REGEXP, which are commonly
    used in configs, so you may encounter errors like "Can't store CODE
    items" or "Can't store REGEXP items" on system configuration page.
    
    There is a quick workaround to make it support CODE, but seems there
    isn't a simple way to support REGEXP. Migrating to Clone::clone could
    fix both.
    
    Note that Clone is not a new dependency because DBIx::SearchBuilder
    requires it for decades, adding it to rt-test-dependencies is just for
    consistency since now we require it directly in RT.
    
    Fixes: I#33019, I#33581

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index e73273012..815a441bd 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -55,7 +55,6 @@ use 5.010;
 use File::Spec ();
 use Symbol::Global::Name;
 use List::MoreUtils 'uniq';
-use Storable ();
 
 =head1 NAME
 
@@ -1518,7 +1517,8 @@ sub GetObfuscated {
 
     return $self->Get(@_) unless $obfuscate;
 
-    my $res = Storable::dclone($self->Get(@_));
+    require Clone;
+    my $res = Clone::clone( $self->Get( @_ ) );
     $res = $obfuscate->( $self, $res, $user );
     return $self->_ReturnValue( $res, $META{$name}->{'Type'} || 'SCALAR' );
 }
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 77d526749..9f90d45e9 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -117,6 +117,7 @@ CGI::Cookie 1.20
 CGI::Emulate::PSGI
 CGI::PSGI 0.12
 Class::Accessor::Fast
+Clone
 Convert::Color
 Crypt::Eksblowfish
 CSS::Minifier::XS

-----------------------------------------------------------------------


More information about the rt-commit mailing list